Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
0d6ddd19
R
Rust
项目概览
int
/
Rust
接近 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
0d6ddd19
编写于
2月 09, 2016
作者:
O
Oliver 'ker' Schneider
提交者:
Oliver Schneider
2月 11, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[breaking-change] don't glob export ast::ForeignItem_ variants
上级
8290c950
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
21 deletion
+20
-21
src/librustc_front/lowering.rs
src/librustc_front/lowering.rs
+2
-2
src/libsyntax/ast.rs
src/libsyntax/ast.rs
+7
-8
src/libsyntax/fold.rs
src/libsyntax/fold.rs
+4
-4
src/libsyntax/parse/parser.rs
src/libsyntax/parse/parser.rs
+3
-3
src/libsyntax/print/pprust.rs
src/libsyntax/print/pprust.rs
+2
-2
src/libsyntax/visit.rs
src/libsyntax/visit.rs
+2
-2
未找到文件。
src/librustc_front/lowering.rs
浏览文件 @
0d6ddd19
...
...
@@ -838,10 +838,10 @@ pub fn lower_foreign_item(lctx: &LoweringContext, i: &ForeignItem) -> hir::Forei
name
:
i
.ident.name
,
attrs
:
lower_attrs
(
lctx
,
&
i
.attrs
),
node
:
match
i
.node
{
ForeignItemFn
(
ref
fdec
,
ref
generics
)
=>
{
ForeignItem
Kind
::
Fn
(
ref
fdec
,
ref
generics
)
=>
{
hir
::
ForeignItemFn
(
lower_fn_decl
(
lctx
,
fdec
),
lower_generics
(
lctx
,
generics
))
}
ForeignItemStatic
(
ref
t
,
m
)
=>
{
ForeignItem
Kind
::
Static
(
ref
t
,
m
)
=>
{
hir
::
ForeignItemStatic
(
lower_ty
(
lctx
,
t
),
m
)
}
},
...
...
src/libsyntax/ast.rs
浏览文件 @
0d6ddd19
...
...
@@ -10,7 +10,6 @@
// The Rust abstract syntax tree.
pub
use
self
::
ForeignItem_
::
*
;
pub
use
self
::
Item_
::
*
;
pub
use
self
::
KleeneOp
::
*
;
pub
use
self
::
MacStmtStyle
::
*
;
...
...
@@ -2039,7 +2038,7 @@ pub fn descriptive_variant(&self) -> &str {
pub
struct
ForeignItem
{
pub
ident
:
Ident
,
pub
attrs
:
Vec
<
Attribute
>
,
pub
node
:
ForeignItem
_
,
pub
node
:
ForeignItem
Kind
,
pub
id
:
NodeId
,
pub
span
:
Span
,
pub
vis
:
Visibility
,
...
...
@@ -2047,19 +2046,19 @@ pub struct ForeignItem {
/// An item within an `extern` block
#[derive(Clone,
PartialEq,
Eq,
RustcEncodable,
RustcDecodable,
Hash,
Debug)]
pub
enum
ForeignItem
_
{
pub
enum
ForeignItem
Kind
{
/// A foreign function
F
oreignItemF
n
(
P
<
FnDecl
>
,
Generics
),
Fn
(
P
<
FnDecl
>
,
Generics
),
/// A foreign static item (`static ext: u8`), with optional mutability
/// (the boolean is true when mutable)
ForeignItem
Static
(
P
<
Ty
>
,
bool
),
Static
(
P
<
Ty
>
,
bool
),
}
impl
ForeignItem
_
{
impl
ForeignItem
Kind
{
pub
fn
descriptive_variant
(
&
self
)
->
&
str
{
match
*
self
{
ForeignItemFn
(
..
)
=>
"foreign function"
,
ForeignItemStatic
(
..
)
=>
"foreign static item"
ForeignItem
Kind
::
Fn
(
..
)
=>
"foreign function"
,
ForeignItem
Kind
::
Static
(
..
)
=>
"foreign static item"
}
}
}
...
...
src/libsyntax/fold.rs
浏览文件 @
0d6ddd19
...
...
@@ -1092,11 +1092,11 @@ pub fn noop_fold_foreign_item<T: Folder>(ni: P<ForeignItem>, folder: &mut T) ->
ident
:
folder
.fold_ident
(
ident
),
attrs
:
fold_attrs
(
attrs
,
folder
),
node
:
match
node
{
ForeignItemFn
(
fdec
,
generics
)
=>
{
ForeignItemFn
(
folder
.fold_fn_decl
(
fdec
),
folder
.fold_generics
(
generics
))
ForeignItem
Kind
::
Fn
(
fdec
,
generics
)
=>
{
ForeignItem
Kind
::
Fn
(
folder
.fold_fn_decl
(
fdec
),
folder
.fold_generics
(
generics
))
}
ForeignItemStatic
(
t
,
m
)
=>
{
ForeignItemStatic
(
folder
.fold_ty
(
t
),
m
)
ForeignItem
Kind
::
Static
(
t
,
m
)
=>
{
ForeignItem
Kind
::
Static
(
folder
.fold_ty
(
t
),
m
)
}
},
vis
:
vis
,
...
...
src/libsyntax/parse/parser.rs
浏览文件 @
0d6ddd19
...
...
@@ -22,7 +22,7 @@
use
ast
::{
EMPTY_CTXT
,
EnumDef
,
ExplicitSelf
};
use
ast
::{
Expr
,
ExprKind
};
use
ast
::{
Field
,
FnDecl
};
use
ast
::{
ForeignItem
,
ForeignItem
Static
,
ForeignItemFn
,
FunctionRetTy
};
use
ast
::{
ForeignItem
,
ForeignItem
Kind
,
FunctionRetTy
};
use
ast
::{
Ident
,
Inherited
,
ImplItem
,
Item
,
Item_
,
ItemStatic
};
use
ast
::{
ItemEnum
,
ItemFn
,
ItemForeignMod
,
ItemImpl
,
ItemConst
};
use
ast
::{
ItemMac
,
ItemMod
,
ItemStruct
,
ItemTrait
,
ItemTy
,
ItemDefaultImpl
};
...
...
@@ -5256,7 +5256,7 @@ fn parse_item_foreign_fn(&mut self, vis: ast::Visibility, lo: BytePos,
Ok
(
P
(
ast
::
ForeignItem
{
ident
:
ident
,
attrs
:
attrs
,
node
:
ForeignItemFn
(
decl
,
generics
),
node
:
ForeignItem
Kind
::
Fn
(
decl
,
generics
),
id
:
ast
::
DUMMY_NODE_ID
,
span
:
mk_sp
(
lo
,
hi
),
vis
:
vis
...
...
@@ -5277,7 +5277,7 @@ fn parse_item_foreign_static(&mut self, vis: ast::Visibility, lo: BytePos,
Ok
(
P
(
ForeignItem
{
ident
:
ident
,
attrs
:
attrs
,
node
:
ForeignItemStatic
(
ty
,
mutbl
),
node
:
ForeignItem
Kind
::
Static
(
ty
,
mutbl
),
id
:
ast
::
DUMMY_NODE_ID
,
span
:
mk_sp
(
lo
,
hi
),
vis
:
vis
...
...
src/libsyntax/print/pprust.rs
浏览文件 @
0d6ddd19
...
...
@@ -1046,7 +1046,7 @@ pub fn print_foreign_item(&mut self,
try!
(
self
.maybe_print_comment
(
item
.span.lo
));
try!
(
self
.print_outer_attributes
(
&
item
.attrs
));
match
item
.node
{
ast
::
ForeignItemFn
(
ref
decl
,
ref
generics
)
=>
{
ast
::
ForeignItem
Kind
::
Fn
(
ref
decl
,
ref
generics
)
=>
{
try!
(
self
.head
(
""
));
try!
(
self
.print_fn
(
decl
,
ast
::
Unsafety
::
Normal
,
ast
::
Constness
::
NotConst
,
...
...
@@ -1056,7 +1056,7 @@ pub fn print_foreign_item(&mut self,
try!
(
word
(
&
mut
self
.s
,
";"
));
self
.end
()
// end the outer fn box
}
ast
::
ForeignItemStatic
(
ref
t
,
m
)
=>
{
ast
::
ForeignItem
Kind
::
Static
(
ref
t
,
m
)
=>
{
try!
(
self
.head
(
&
visibility_qualified
(
item
.vis
,
"static"
)));
if
m
{
...
...
src/libsyntax/visit.rs
浏览文件 @
0d6ddd19
...
...
@@ -467,11 +467,11 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(visitor: &mut V,
visitor
.visit_ident
(
foreign_item
.span
,
foreign_item
.ident
);
match
foreign_item
.node
{
ForeignItemFn
(
ref
function_declaration
,
ref
generics
)
=>
{
ForeignItem
Kind
::
Fn
(
ref
function_declaration
,
ref
generics
)
=>
{
walk_fn_decl
(
visitor
,
function_declaration
);
visitor
.visit_generics
(
generics
)
}
ForeignItemStatic
(
ref
typ
,
_
)
=>
visitor
.visit_ty
(
typ
),
ForeignItem
Kind
::
Static
(
ref
typ
,
_
)
=>
visitor
.visit_ty
(
typ
),
}
walk_list!
(
visitor
,
visit_attribute
,
&
foreign_item
.attrs
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录