Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
8830f8e3
R
Rust
项目概览
int
/
Rust
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8830f8e3
编写于
8月 05, 2021
作者:
E
est31
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove box syntax from rustc_parse
上级
823e6f16
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
8 deletion
+7
-8
compiler/rustc_parse/src/lib.rs
compiler/rustc_parse/src/lib.rs
+0
-1
compiler/rustc_parse/src/parser/item.rs
compiler/rustc_parse/src/parser/item.rs
+7
-7
未找到文件。
compiler/rustc_parse/src/lib.rs
浏览文件 @
8830f8e3
...
...
@@ -3,7 +3,6 @@
#![feature(array_windows)]
#![feature(crate_visibility_modifier)]
#![cfg_attr(bootstrap,
feature(bindings_after_at))]
#![feature(box_syntax)]
#![feature(box_patterns)]
#![recursion_limit
=
"256"
]
...
...
compiler/rustc_parse/src/parser/item.rs
浏览文件 @
8830f8e3
...
...
@@ -221,7 +221,7 @@ fn parse_item_kind(
}
else
if
self
.check_fn_front_matter
(
def_final
)
{
// FUNCTION ITEM
let
(
ident
,
sig
,
generics
,
body
)
=
self
.parse_fn
(
attrs
,
req_name
,
lo
)
?
;
(
ident
,
ItemKind
::
Fn
(
box
FnKind
(
def
(),
sig
,
generics
,
body
)))
(
ident
,
ItemKind
::
Fn
(
Box
::
new
(
FnKind
(
def
(),
sig
,
generics
,
body
)
)))
}
else
if
self
.eat_keyword
(
kw
::
Extern
)
{
if
self
.eat_keyword
(
kw
::
Crate
)
{
// EXTERN CRATE
...
...
@@ -548,7 +548,7 @@ fn parse_item_impl(
};
let
trait_ref
=
TraitRef
{
path
,
ref_id
:
ty_first
.id
};
ItemKind
::
Impl
(
box
ImplKind
{
ItemKind
::
Impl
(
Box
::
new
(
ImplKind
{
unsafety
,
polarity
,
defaultness
,
...
...
@@ -557,11 +557,11 @@ fn parse_item_impl(
of_trait
:
Some
(
trait_ref
),
self_ty
:
ty_second
,
items
:
impl_items
,
})
})
)
}
None
=>
{
// impl Type
ItemKind
::
Impl
(
box
ImplKind
{
ItemKind
::
Impl
(
Box
::
new
(
ImplKind
{
unsafety
,
polarity
,
defaultness
,
...
...
@@ -570,7 +570,7 @@ fn parse_item_impl(
of_trait
:
None
,
self_ty
:
ty_first
,
items
:
impl_items
,
})
})
)
}
};
...
...
@@ -710,7 +710,7 @@ fn parse_item_trait(&mut self, attrs: &mut Vec<Attribute>, lo: Span) -> PResult<
// It's a normal trait.
tps
.where_clause
=
self
.parse_where_clause
()
?
;
let
items
=
self
.parse_item_list
(
attrs
,
|
p
|
p
.parse_trait_item
(
ForceCollect
::
No
))
?
;
Ok
((
ident
,
ItemKind
::
Trait
(
box
TraitKind
(
is_auto
,
unsafety
,
tps
,
bounds
,
items
))))
Ok
((
ident
,
ItemKind
::
Trait
(
Box
::
new
(
TraitKind
(
is_auto
,
unsafety
,
tps
,
bounds
,
items
)
))))
}
}
...
...
@@ -769,7 +769,7 @@ fn parse_type_alias(&mut self, def: Defaultness) -> PResult<'a, ItemInfo> {
let
default
=
if
self
.eat
(
&
token
::
Eq
)
{
Some
(
self
.parse_ty
()
?
)
}
else
{
None
};
self
.expect_semi
()
?
;
Ok
((
ident
,
ItemKind
::
TyAlias
(
box
TyAliasKind
(
def
,
generics
,
bounds
,
default
))))
Ok
((
ident
,
ItemKind
::
TyAlias
(
Box
::
new
(
TyAliasKind
(
def
,
generics
,
bounds
,
default
)
))))
}
/// Parses a `UseTree`.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录