Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
e36872da
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,发现更多精彩内容 >>
提交
e36872da
编写于
11月 12, 2015
作者:
O
Oliver Schneider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ImplItem_ -> ImplItemKind rename
上级
eaaa60db
变更
30
隐藏空白更改
内联
并排
Showing
30 changed file
with
99 addition
and
99 deletion
+99
-99
src/librustc/front/map/collector.rs
src/librustc/front/map/collector.rs
+3
-3
src/librustc/front/map/mod.rs
src/librustc/front/map/mod.rs
+3
-3
src/librustc/metadata/encoder.rs
src/librustc/metadata/encoder.rs
+1
-1
src/librustc/middle/check_const.rs
src/librustc/middle/check_const.rs
+1
-1
src/librustc/middle/check_static_recursion.rs
src/librustc/middle/check_static_recursion.rs
+1
-1
src/librustc/middle/const_eval.rs
src/librustc/middle/const_eval.rs
+3
-3
src/librustc/middle/dead.rs
src/librustc/middle/dead.rs
+6
-6
src/librustc/middle/infer/error_reporting.rs
src/librustc/middle/infer/error_reporting.rs
+2
-2
src/librustc/middle/reachable.rs
src/librustc/middle/reachable.rs
+6
-6
src/librustc/middle/ty/mod.rs
src/librustc/middle/ty/mod.rs
+4
-4
src/librustc_borrowck/borrowck/mod.rs
src/librustc_borrowck/borrowck/mod.rs
+1
-1
src/librustc_front/fold.rs
src/librustc_front/fold.rs
+5
-5
src/librustc_front/hir.rs
src/librustc_front/hir.rs
+2
-2
src/librustc_front/lowering.rs
src/librustc_front/lowering.rs
+3
-3
src/librustc_front/print/pprust.rs
src/librustc_front/print/pprust.rs
+3
-3
src/librustc_front/visit.rs
src/librustc_front/visit.rs
+3
-3
src/librustc_lint/bad_style.rs
src/librustc_lint/bad_style.rs
+1
-1
src/librustc_lint/builtin.rs
src/librustc_lint/builtin.rs
+3
-3
src/librustc_mir/mir_map.rs
src/librustc_mir/mir_map.rs
+2
-2
src/librustc_privacy/lib.rs
src/librustc_privacy/lib.rs
+12
-12
src/librustc_resolve/lib.rs
src/librustc_resolve/lib.rs
+4
-4
src/librustc_trans/trans/base.rs
src/librustc_trans/trans/base.rs
+2
-2
src/librustc_trans/trans/debuginfo/mod.rs
src/librustc_trans/trans/debuginfo/mod.rs
+1
-1
src/librustc_trans/trans/inline.rs
src/librustc_trans/trans/inline.rs
+1
-1
src/librustc_trans/trans/meth.rs
src/librustc_trans/trans/meth.rs
+2
-2
src/librustc_trans/trans/monomorphize.rs
src/librustc_trans/trans/monomorphize.rs
+1
-1
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/mod.rs
+9
-9
src/librustc_typeck/coherence/mod.rs
src/librustc_typeck/coherence/mod.rs
+3
-3
src/librustc_typeck/collect.rs
src/librustc_typeck/collect.rs
+8
-8
src/librustdoc/clean/mod.rs
src/librustdoc/clean/mod.rs
+3
-3
未找到文件。
src/librustc/front/map/collector.rs
浏览文件 @
e36872da
...
...
@@ -224,8 +224,8 @@ fn visit_trait_item(&mut self, ti: &'ast TraitItem) {
fn
visit_impl_item
(
&
mut
self
,
ii
:
&
'ast
ImplItem
)
{
let
def_data
=
match
ii
.node
{
ImplItem
_
::
Method
(
..
)
|
ImplItem_
::
Const
(
..
)
=>
DefPathData
::
Value
(
ii
.name
),
ImplItem
_
::
Type
(
..
)
=>
DefPathData
::
Type
(
ii
.name
),
ImplItem
Kind
::
Method
(
..
)
|
ImplItemKind
::
Const
(
..
)
=>
DefPathData
::
Value
(
ii
.name
),
ImplItem
Kind
::
Type
(
..
)
=>
DefPathData
::
Type
(
ii
.name
),
};
self
.insert_def
(
ii
.id
,
NodeImplItem
(
ii
),
def_data
);
...
...
@@ -234,7 +234,7 @@ fn visit_impl_item(&mut self, ii: &'ast ImplItem) {
self
.parent_node
=
ii
.id
;
match
ii
.node
{
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
{
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
{
self
.create_def
(
expr
.id
,
DefPathData
::
Initializer
);
}
_
=>
{
}
...
...
src/librustc/front/map/mod.rs
浏览文件 @
e36872da
...
...
@@ -937,18 +937,18 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
}
Some
(
NodeImplItem
(
ii
))
=>
{
match
ii
.node
{
ImplItem
_
::
Const
(
..
)
=>
{
ImplItem
Kind
::
Const
(
..
)
=>
{
format!
(
"assoc const {} in {}{}"
,
ii
.name
,
map
.path_to_string
(
id
),
id_str
)
}
ImplItem
_
::
Method
(
..
)
=>
{
ImplItem
Kind
::
Method
(
..
)
=>
{
format!
(
"method {} in {}{}"
,
ii
.name
,
map
.path_to_string
(
id
),
id_str
)
}
ImplItem
_
::
Type
(
_
)
=>
{
ImplItem
Kind
::
Type
(
_
)
=>
{
format!
(
"assoc type {} in {}{}"
,
ii
.name
,
map
.path_to_string
(
id
),
...
...
src/librustc/metadata/encoder.rs
浏览文件 @
e36872da
...
...
@@ -739,7 +739,7 @@ fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
let
elem
=
ast_map
::
PathName
(
m
.name
);
encode_path
(
rbml_w
,
impl_path
.chain
(
Some
(
elem
)));
if
let
Some
(
impl_item
)
=
impl_item_opt
{
if
let
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=
impl_item
.node
{
if
let
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=
impl_item
.node
{
encode_attributes
(
rbml_w
,
&
impl_item
.attrs
);
let
scheme
=
ecx
.tcx
.lookup_item_type
(
m
.def_id
);
let
any_types
=
!
scheme
.generics.types
.is_empty
();
...
...
src/librustc/middle/check_const.rs
浏览文件 @
e36872da
...
...
@@ -348,7 +348,7 @@ fn visit_trait_item(&mut self, t: &'v hir::TraitItem) {
fn
visit_impl_item
(
&
mut
self
,
i
:
&
'v
hir
::
ImplItem
)
{
match
i
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
{
self
.global_expr
(
Mode
::
Const
,
&*
expr
);
}
_
=>
self
.with_mode
(
Mode
::
Var
,
|
v
|
visit
::
walk_impl_item
(
v
,
i
)),
...
...
src/librustc/middle/check_static_recursion.rs
浏览文件 @
e36872da
...
...
@@ -79,7 +79,7 @@ fn visit_trait_item(&mut self, ti: &'ast hir::TraitItem) {
fn
visit_impl_item
(
&
mut
self
,
ii
:
&
'ast
hir
::
ImplItem
)
{
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
let
mut
recursion_visitor
=
CheckItemRecursionVisitor
::
new
(
self
,
&
ii
.span
);
recursion_visitor
.visit_impl_item
(
ii
);
...
...
src/librustc/middle/const_eval.rs
浏览文件 @
e36872da
...
...
@@ -129,7 +129,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: &'a ty::ctxt<'tcx>,
_
=>
None
},
Some
(
ast_map
::
NodeImplItem
(
ii
))
=>
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
{
Some
(
&*
expr
)
}
_
=>
None
...
...
@@ -171,7 +171,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: &'a ty::ctxt<'tcx>,
_
=>
None
},
csearch
::
FoundAst
::
Found
(
&
InlinedItem
::
ImplItem
(
_
,
ref
ii
))
=>
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
Some
(
expr
.id
),
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
Some
(
expr
.id
),
_
=>
None
},
_
=>
None
...
...
@@ -996,7 +996,7 @@ fn fromb(b: bool) -> ConstVal { Int(b as i64) }
},
ty
::
ImplContainer
(
_
)
=>
match
tcx
.map
.find
(
node_id
)
{
Some
(
ast_map
::
NodeImplItem
(
ii
))
=>
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
ref
ty
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
ref
ty
,
ref
expr
)
=>
{
(
Some
(
&**
expr
),
Some
(
&**
ty
))
}
_
=>
(
None
,
None
)
...
...
src/librustc/middle/dead.rs
浏览文件 @
e36872da
...
...
@@ -358,14 +358,14 @@ fn visit_item(&mut self, item: &hir::Item) {
hir
::
ItemImpl
(
_
,
_
,
_
,
ref
opt_trait
,
_
,
ref
impl_items
)
=>
{
for
impl_item
in
impl_items
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
|
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
|
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
if
opt_trait
.is_some
()
||
has_allow_dead_code_or_lang_attr
(
&
impl_item
.attrs
)
{
self
.worklist
.push
(
impl_item
.id
);
}
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
{}
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{}
}
}
}
...
...
@@ -571,21 +571,21 @@ fn visit_struct_field(&mut self, field: &hir::StructField) {
fn
visit_impl_item
(
&
mut
self
,
impl_item
:
&
hir
::
ImplItem
)
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
{
if
!
self
.symbol_is_live
(
impl_item
.id
,
None
)
{
self
.warn_dead_code
(
impl_item
.id
,
impl_item
.span
,
impl_item
.name
,
"associated const"
);
}
visit
::
walk_expr
(
self
,
expr
)
}
hir
::
ImplItem
_
::
Method
(
_
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
_
,
ref
body
)
=>
{
if
!
self
.symbol_is_live
(
impl_item
.id
,
None
)
{
self
.warn_dead_code
(
impl_item
.id
,
impl_item
.span
,
impl_item
.name
,
"method"
);
}
visit
::
walk_block
(
self
,
body
)
}
hir
::
ImplItem
_
::
Type
(
..
)
=>
{}
hir
::
ImplItem
Kind
::
Type
(
..
)
=>
{}
}
}
...
...
src/librustc/middle/infer/error_reporting.rs
浏览文件 @
e36872da
...
...
@@ -948,7 +948,7 @@ fn give_suggestion(&self, same_regions: &[SameRegions]) {
}
ast_map
::
NodeImplItem
(
item
)
=>
{
match
item
.node
{
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
{
Some
((
&
sig
.decl
,
&
sig
.generics
,
sig
.unsafety
,
...
...
@@ -1839,7 +1839,7 @@ fn lifetimes_in_scope(tcx: &ty::ctxt,
},
ast_map
::
NodeImplItem
(
ii
)
=>
{
match
ii
.node
{
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
{
taken
.push_all
(
&
sig
.generics.lifetimes
);
Some
(
ii
.id
)
}
...
...
src/librustc/middle/reachable.rs
浏览文件 @
e36872da
...
...
@@ -185,8 +185,8 @@ fn def_id_represents_local_inlined_item(&self, def_id: DefId) -> bool {
}
Some
(
ast_map
::
NodeImplItem
(
impl_item
))
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
true
,
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
true
,
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
{
if
generics_require_inlining
(
&
sig
.generics
)
||
attr
::
requests_inline
(
&
impl_item
.attrs
)
{
true
...
...
@@ -206,7 +206,7 @@ fn def_id_represents_local_inlined_item(&self, def_id: DefId) -> bool {
}
}
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
false
,
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
false
,
}
}
Some
(
_
)
=>
false
,
...
...
@@ -299,16 +299,16 @@ fn propagate_node(&mut self, node: &ast_map::Node,
}
ast_map
::
NodeImplItem
(
impl_item
)
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
{
self
.visit_expr
(
&*
expr
);
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
let
did
=
self
.tcx.map
.get_parent_did
(
search_item
);
if
method_might_be_inlined
(
self
.tcx
,
sig
,
impl_item
,
did
)
{
visit
::
walk_block
(
self
,
body
)
}
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
{}
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{}
}
}
// Nothing to recurse on for these
...
...
src/librustc/middle/ty/mod.rs
浏览文件 @
e36872da
...
...
@@ -1124,7 +1124,7 @@ pub fn for_item(cx: &'a ctxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 'tcx
match
cx
.map
.find
(
id
)
{
Some
(
ast_map
::
NodeImplItem
(
ref
impl_item
))
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Type
(
_
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{
// associated types don't have their own entry (for some reason),
// so for now just grab environment for the impl
let
impl_id
=
cx
.map
.get_parent
(
id
);
...
...
@@ -1136,7 +1136,7 @@ pub fn for_item(cx: &'a ctxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 'tcx
&
predicates
,
id
)
}
hir
::
ImplItem
_
::
Const
(
_
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
_
,
_
)
=>
{
let
def_id
=
cx
.map
.local_def_id
(
id
);
let
scheme
=
cx
.lookup_item_type
(
def_id
);
let
predicates
=
cx
.lookup_predicates
(
def_id
);
...
...
@@ -1145,7 +1145,7 @@ pub fn for_item(cx: &'a ctxt<'tcx>, id: NodeId) -> ParameterEnvironment<'a, 'tcx
&
predicates
,
id
)
}
hir
::
ImplItem
_
::
Method
(
_
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
_
,
ref
body
)
=>
{
let
method_def_id
=
cx
.map
.local_def_id
(
id
);
match
cx
.impl_or_trait_item
(
method_def_id
)
{
MethodTraitItem
(
ref
method_ty
)
=>
{
...
...
@@ -2158,7 +2158,7 @@ pub fn associated_consts(&self, id: DefId) -> Vec<Rc<AssociatedConst<'tcx>>> {
}
ItemImpl
(
_
,
_
,
_
,
_
,
_
,
ref
iis
)
=>
{
iis
.iter
()
.filter_map
(|
ii
|
{
if
let
hir
::
ImplItem
_
::
Const
(
_
,
_
)
=
ii
.node
{
if
let
hir
::
ImplItem
Kind
::
Const
(
_
,
_
)
=
ii
.node
{
match
self
.impl_or_trait_item
(
self
.map
.local_def_id
(
ii
.id
))
{
ConstTraitItem
(
ac
)
=>
Some
(
ac
),
_
=>
{
...
...
src/librustc_borrowck/borrowck/mod.rs
浏览文件 @
e36872da
...
...
@@ -89,7 +89,7 @@ fn visit_trait_item(&mut self, ti: &hir::TraitItem) {
}
fn
visit_impl_item
(
&
mut
self
,
ii
:
&
hir
::
ImplItem
)
{
if
let
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=
ii
.node
{
if
let
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=
ii
.node
{
gather_loans
::
gather_loans_in_static_initializer
(
self
,
&*
expr
);
}
visit
::
walk_impl_item
(
self
,
ii
);
...
...
src/librustc_front/fold.rs
浏览文件 @
e36872da
...
...
@@ -867,13 +867,13 @@ pub fn noop_fold_impl_item<T: Folder>(i: P<ImplItem>, folder: &mut T) -> P<ImplI
attrs
:
fold_attrs
(
attrs
,
folder
),
vis
:
vis
,
node
:
match
node
{
ImplItem
_
::
Const
(
ty
,
expr
)
=>
{
ImplItem
_
::
Const
(
folder
.fold_ty
(
ty
),
folder
.fold_expr
(
expr
))
ImplItem
Kind
::
Const
(
ty
,
expr
)
=>
{
ImplItem
Kind
::
Const
(
folder
.fold_ty
(
ty
),
folder
.fold_expr
(
expr
))
}
ImplItem
_
::
Method
(
sig
,
body
)
=>
{
ImplItem
_
::
Method
(
noop_fold_method_sig
(
sig
,
folder
),
folder
.fold_block
(
body
))
ImplItem
Kind
::
Method
(
sig
,
body
)
=>
{
ImplItem
Kind
::
Method
(
noop_fold_method_sig
(
sig
,
folder
),
folder
.fold_block
(
body
))
}
ImplItem
_
::
Type
(
ty
)
=>
ImplItem_
::
Type
(
folder
.fold_ty
(
ty
)),
ImplItem
Kind
::
Type
(
ty
)
=>
ImplItemKind
::
Type
(
folder
.fold_ty
(
ty
)),
},
span
:
folder
.new_span
(
span
),
}
...
...
src/librustc_front/hir.rs
浏览文件 @
e36872da
...
...
@@ -770,12 +770,12 @@ pub struct ImplItem {
pub
name
:
Name
,
pub
vis
:
Visibility
,
pub
attrs
:
Vec
<
Attribute
>
,
pub
node
:
ImplItem
_
,
pub
node
:
ImplItem
Kind
,
pub
span
:
Span
,
}
#[derive(Clone,
PartialEq,
Eq,
RustcEncodable,
RustcDecodable,
Hash,
Debug)]
pub
enum
ImplItem
_
{
pub
enum
ImplItem
Kind
{
Const
(
P
<
Ty
>
,
P
<
Expr
>
),
Method
(
MethodSig
,
P
<
Block
>
),
Type
(
P
<
Ty
>
),
...
...
src/librustc_front/lowering.rs
浏览文件 @
e36872da
...
...
@@ -676,12 +676,12 @@ pub fn lower_impl_item(_lctx: &LoweringContext, i: &ImplItem) -> P<hir::ImplItem
vis
:
lower_visibility
(
_
lctx
,
i
.vis
),
node
:
match
i
.node
{
ConstImplItem
(
ref
ty
,
ref
expr
)
=>
{
hir
::
ImplItem
_
::
Const
(
lower_ty
(
_
lctx
,
ty
),
lower_expr
(
_
lctx
,
expr
))
hir
::
ImplItem
Kind
::
Const
(
lower_ty
(
_
lctx
,
ty
),
lower_expr
(
_
lctx
,
expr
))
}
MethodImplItem
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
_
::
Method
(
lower_method_sig
(
_
lctx
,
sig
),
lower_block
(
_
lctx
,
body
))
hir
::
ImplItem
Kind
::
Method
(
lower_method_sig
(
_
lctx
,
sig
),
lower_block
(
_
lctx
,
body
))
}
TypeImplItem
(
ref
ty
)
=>
hir
::
ImplItem
_
::
Type
(
lower_ty
(
_
lctx
,
ty
)),
TypeImplItem
(
ref
ty
)
=>
hir
::
ImplItem
Kind
::
Type
(
lower_ty
(
_
lctx
,
ty
)),
MacImplItem
(
..
)
=>
panic!
(
"Shouldn't exist any more"
),
},
span
:
i
.span
,
...
...
src/librustc_front/print/pprust.rs
浏览文件 @
e36872da
...
...
@@ -1011,16 +1011,16 @@ pub fn print_impl_item(&mut self, ii: &hir::ImplItem) -> io::Result<()> {
try!
(
self
.maybe_print_comment
(
ii
.span.lo
));
try!
(
self
.print_outer_attributes
(
&
ii
.attrs
));
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
ref
ty
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
ref
ty
,
ref
expr
)
=>
{
try!
(
self
.print_associated_const
(
ii
.name
,
&
ty
,
Some
(
&
expr
),
ii
.vis
));
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
try!
(
self
.head
(
""
));
try!
(
self
.print_method_sig
(
ii
.name
,
sig
,
ii
.vis
));
try!
(
self
.nbsp
());
try!
(
self
.print_block_with_attrs
(
body
,
&
ii
.attrs
));
}
hir
::
ImplItem
_
::
Type
(
ref
ty
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
ref
ty
)
=>
{
try!
(
self
.print_associated_type
(
ii
.name
,
None
,
Some
(
ty
)));
}
}
...
...
src/librustc_front/visit.rs
浏览文件 @
e36872da
...
...
@@ -614,18 +614,18 @@ pub fn walk_impl_item<'v, V: Visitor<'v>>(visitor: &mut V, impl_item: &'v ImplIt
visitor
.visit_name
(
impl_item
.span
,
impl_item
.name
);
walk_list!
(
visitor
,
visit_attribute
,
&
impl_item
.attrs
);
match
impl_item
.node
{
ImplItem
_
::
Const
(
ref
ty
,
ref
expr
)
=>
{
ImplItem
Kind
::
Const
(
ref
ty
,
ref
expr
)
=>
{
visitor
.visit_ty
(
ty
);
visitor
.visit_expr
(
expr
);
}
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
visitor
.visit_fn
(
FnKind
::
Method
(
impl_item
.name
,
sig
,
Some
(
impl_item
.vis
)),
&
sig
.decl
,
body
,
impl_item
.span
,
impl_item
.id
);
}
ImplItem
_
::
Type
(
ref
ty
)
=>
{
ImplItem
Kind
::
Type
(
ref
ty
)
=>
{
visitor
.visit_ty
(
ty
);
}
}
...
...
src/librustc_lint/bad_style.rs
浏览文件 @
e36872da
...
...
@@ -351,7 +351,7 @@ fn check_trait_item(&mut self, cx: &LateContext, ti: &hir::TraitItem) {
fn
check_impl_item
(
&
mut
self
,
cx
:
&
LateContext
,
ii
:
&
hir
::
ImplItem
)
{
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
NonUpperCaseGlobals
::
check_upper_case
(
cx
,
"associated constant"
,
ii
.name
,
ii
.span
);
}
...
...
src/librustc_lint/builtin.rs
浏览文件 @
e36872da
...
...
@@ -505,9 +505,9 @@ fn check_impl_item(&mut self, cx: &LateContext, impl_item: &hir::ImplItem) {
}
let
desc
=
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
"an associated constant"
,
hir
::
ImplItem
_
::
Method
(
..
)
=>
"a method"
,
hir
::
ImplItem
_
::
Type
(
_
)
=>
"an associated type"
,
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
"an associated constant"
,
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
"a method"
,
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
"an associated type"
,
};
self
.check_missing_docs_attrs
(
cx
,
Some
(
impl_item
.id
),
&
impl_item
.attrs
,
...
...
src/librustc_mir/mir_map.rs
浏览文件 @
e36872da
...
...
@@ -99,10 +99,10 @@ fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem) {
fn
visit_impl_item
(
&
mut
self
,
impl_item
:
&
'tcx
hir
::
ImplItem
)
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
self
.visit_mir
(
&
impl_item
.attrs
,
|
c
|
visit
::
walk_impl_item
(
c
,
impl_item
));
}
hir
::
ImplItem
_
::
Const
(
..
)
|
hir
::
ImplItem_
::
Type
(
..
)
=>
{}
hir
::
ImplItem
Kind
::
Const
(
..
)
|
hir
::
ImplItemKind
::
Type
(
..
)
=>
{}
}
visit
::
walk_impl_item
(
self
,
impl_item
);
}
...
...
src/librustc_privacy/lib.rs
浏览文件 @
e36872da
...
...
@@ -553,8 +553,8 @@ fn def_privacy(&self, did: DefId) -> PrivacyResult {
// where the method was defined?
Some
(
ast_map
::
NodeImplItem
(
ii
))
=>
{
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
|
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
|
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
let
imp
=
self
.tcx.map
.get_parent_did
(
closest_private_id
);
match
self
.tcx
.impl_trait_ref
(
imp
)
{
...
...
@@ -565,7 +565,7 @@ fn def_privacy(&self, did: DefId) -> PrivacyResult {
_
=>
ii
.vis
}
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
return
Allowable
,
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
return
Allowable
,
}
}
Some
(
ast_map
::
NodeTraitItem
(
_
))
=>
{
...
...
@@ -1293,11 +1293,11 @@ fn visit_item(&mut self, item: &hir::Item) {
impl_items
.iter
()
.any
(|
impl_item
|
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
|
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
|
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
self
.exported_items
.contains
(
&
impl_item
.id
)
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
false
,
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
false
,
}
});
...
...
@@ -1316,13 +1316,13 @@ fn visit_item(&mut self, item: &hir::Item) {
// don't erroneously report errors for private
// types in private items.
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
|
hir
::
ImplItem
_
::
Method
(
..
)
hir
::
ImplItem
Kind
::
Const
(
..
)
|
hir
::
ImplItem
Kind
::
Method
(
..
)
if
self
.item_is_public
(
&
impl_item
.id
,
impl_item
.vis
)
=>
{
visit
::
walk_impl_item
(
self
,
impl_item
)
}
hir
::
ImplItem
_
::
Type
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
..
)
=>
{
visit
::
walk_impl_item
(
self
,
impl_item
)
}
_
=>
{}
...
...
@@ -1347,7 +1347,7 @@ fn visit_item(&mut self, item: &hir::Item) {
// Those in 3. are warned with this call.
for
impl_item
in
impl_items
{
if
let
hir
::
ImplItem
_
::
Type
(
ref
ty
)
=
impl_item
.node
{
if
let
hir
::
ImplItem
Kind
::
Type
(
ref
ty
)
=
impl_item
.node
{
self
.visit_ty
(
ty
);
}
}
...
...
@@ -1359,13 +1359,13 @@ fn visit_item(&mut self, item: &hir::Item) {
let
mut
found_pub_static
=
false
;
for
impl_item
in
impl_items
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
if
self
.item_is_public
(
&
impl_item
.id
,
impl_item
.vis
)
{
found_pub_static
=
true
;
visit
::
walk_impl_item
(
self
,
impl_item
);
}
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
{
if
sig
.explicit_self.node
==
hir
::
SelfStatic
&&
self
.item_is_public
(
&
impl_item
.id
,
impl_item
.vis
)
{
found_pub_static
=
true
;
...
...
src/librustc_resolve/lib.rs
浏览文件 @
e36872da
...
...
@@ -2420,7 +2420,7 @@ fn resolve_implementation(&mut self,
this
.with_current_self_type
(
self_type
,
|
this
|
{
for
impl_item
in
impl_items
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
// If this is a trait impl, ensure the const
// exists in trait
this
.check_trait_item
(
impl_item
.name
,
...
...
@@ -2430,7 +2430,7 @@ fn resolve_implementation(&mut self,
visit
::
walk_impl_item
(
this
,
impl_item
);
});
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
{
// If this is a trait impl, ensure the method
// exists in trait
this
.check_trait_item
(
impl_item
.name
,
...
...
@@ -2447,7 +2447,7 @@ fn resolve_implementation(&mut self,
visit
::
walk_impl_item
(
this
,
impl_item
);
});
}
hir
::
ImplItem
_
::
Type
(
ref
ty
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
ref
ty
)
=>
{
// If this is a trait impl, ensure the type
// exists in trait
this
.check_trait_item
(
impl_item
.name
,
...
...
@@ -3544,7 +3544,7 @@ fn is_static_method(this: &Resolver, did: DefId) -> bool {
_
=>
return
false
,
},
hir_map
::
NodeImplItem
(
impl_item
)
=>
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
sig
,
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
sig
,
_
=>
return
false
,
},
_
=>
return
false
,
...
...
src/librustc_trans/trans/base.rs
浏览文件 @
e36872da
...
...
@@ -1326,7 +1326,7 @@ fn build_cfg(tcx: &ty::ctxt, id: ast::NodeId) -> (ast::NodeId, Option<cfg::CFG>)
}
Some
(
hir_map
::
NodeImplItem
(
impl_item
))
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
_
,
ref
body
)
=>
body
,
hir
::
ImplItem
Kind
::
Method
(
_
,
ref
body
)
=>
body
,
_
=>
{
tcx
.sess
.bug
(
"unexpected variant: non-method impl item in
\
has_nested_returns"
)
...
...
@@ -2614,7 +2614,7 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
hir_map
::
NodeImplItem
(
impl_item
)
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
register_method
(
ccx
,
id
,
&
impl_item
.attrs
,
impl_item
.span
)
}
_
=>
{
...
...
src/librustc_trans/trans/debuginfo/mod.rs
浏览文件 @
e36872da
...
...
@@ -253,7 +253,7 @@ pub fn create_function_debug_context<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
}
hir_map
::
NodeImplItem
(
impl_item
)
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
if
contains_nodebug_attribute
(
&
impl_item
.attrs
)
{
return
FunctionDebugContext
::
FunctionWithoutDebugInfo
;
}
...
...
src/librustc_trans/trans/inline.rs
浏览文件 @
e36872da
...
...
@@ -160,7 +160,7 @@ fn instantiate_inline(ccx: &CrateContext, fn_id: DefId)
ccx
.stats
()
.n_inlines
.set
(
ccx
.stats
()
.n_inlines
.get
()
+
1
);
// Translate monomorphic impl methods immediately.
if
let
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=
impl_item
.node
{
if
let
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=
impl_item
.node
{
let
impl_tpt
=
ccx
.tcx
()
.lookup_item_type
(
impl_did
);
if
impl_tpt
.generics.types
.is_empty
()
&&
sig
.generics.ty_params
.is_empty
()
{
...
...
src/librustc_trans/trans/meth.rs
浏览文件 @
e36872da
...
...
@@ -70,7 +70,7 @@ pub fn trans_impl(ccx: &CrateContext,
if
!
generics
.ty_params
.is_empty
()
{
for
impl_item
in
impl_items
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
visit
::
walk_impl_item
(
&
mut
v
,
impl_item
);
}
_
=>
{}
...
...
@@ -80,7 +80,7 @@ pub fn trans_impl(ccx: &CrateContext,
}
for
impl_item
in
impl_items
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
if
sig
.generics.ty_params
.is_empty
()
{
let
trans_everywhere
=
attr
::
requests_inline
(
&
impl_item
.attrs
);
for
(
ref
ccx
,
is_origin
)
in
ccx
.maybe_iter
(
trans_everywhere
)
{
...
...
src/librustc_trans/trans/monomorphize.rs
浏览文件 @
e36872da
...
...
@@ -206,7 +206,7 @@ pub fn monomorphic_fn<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
}
hir_map
::
NodeImplItem
(
impl_item
)
=>
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
let
d
=
mk_lldecl
(
abi
::
Rust
);
let
needs_body
=
setup_lldecl
(
d
,
&
impl_item
.attrs
);
if
needs_body
{
...
...
src/librustc_typeck/check/mod.rs
浏览文件 @
e36872da
...
...
@@ -764,14 +764,14 @@ pub fn check_item_body<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>, it: &'tcx hir::Item) {
for
impl_item
in
impl_items
{
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
_
,
ref
expr
)
=>
{
check_const
(
ccx
,
impl_item
.span
,
&*
expr
,
impl_item
.id
)
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
check_method_body
(
ccx
,
&
impl_pty
.generics
,
sig
,
body
,
impl_item
.id
,
impl_item
.span
);
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{
// Nothing to do here.
}
}
...
...
@@ -908,7 +908,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
impl_trait_ref
));
});
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
let
impl_const
=
match
ty_impl_item
{
ty
::
ConstTraitItem
(
ref
cti
)
=>
cti
,
_
=>
tcx
.sess
.span_bug
(
impl_item
.span
,
"non-const impl-item for const"
)
...
...
@@ -929,7 +929,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
impl_trait_ref
)
}
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=>
{
check_trait_fn_not_const
(
ccx
,
impl_item
.span
,
sig
.constness
);
let
impl_method
=
match
ty_impl_item
{
...
...
@@ -952,7 +952,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
impl_trait_ref
)
}
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{
let
impl_type
=
match
ty_impl_item
{
ty
::
TypeTraitItem
(
ref
tti
)
=>
tti
,
_
=>
tcx
.sess
.span_bug
(
impl_item
.span
,
"non-type impl-item for type"
)
...
...
@@ -983,7 +983,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
ty
::
ConstTraitItem
(
ref
associated_const
)
=>
{
let
is_implemented
=
impl_items
.iter
()
.any
(|
ii
|
{
match
ii
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
ii
.name
==
associated_const
.name
}
_
=>
false
,
...
...
@@ -1003,7 +1003,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
let
is_implemented
=
impl_items
.iter
()
.any
(|
ii
|
{
match
ii
.node
{
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
ii
.name
==
trait_method
.name
}
_
=>
false
,
...
...
@@ -1022,7 +1022,7 @@ fn check_impl_items_against_trait<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
ty
::
TypeTraitItem
(
ref
associated_type
)
=>
{
let
is_implemented
=
impl_items
.iter
()
.any
(|
ii
|
{
match
ii
.node
{
hir
::
ImplItem
_
::
Type
(
_
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{
ii
.name
==
associated_type
.name
}
_
=>
false
,
...
...
src/librustc_typeck/coherence/mod.rs
浏览文件 @
e36872da
...
...
@@ -196,13 +196,13 @@ fn create_impl_from_item(&self, item: &Item) -> Vec<ImplOrTraitItemId> {
impl_items
.iter
()
.map
(|
impl_item
|
{
let
impl_def_id
=
self
.crate_context.tcx.map
.local_def_id
(
impl_item
.id
);
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
..
)
=>
{
ConstTraitItemId
(
impl_def_id
)
}
hir
::
ImplItem
_
::
Method
(
..
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
..
)
=>
{
MethodTraitItemId
(
impl_def_id
)
}
hir
::
ImplItem
_
::
Type
(
_
)
=>
{
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
{
TypeTraitItemId
(
impl_def_id
)
}
}
...
...
src/librustc_typeck/collect.rs
浏览文件 @
e36872da
...
...
@@ -821,14 +821,14 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
for
impl_item
in
impl_items
{
let
seen_items
=
match
impl_item
.node
{
hir
::
ImplItem
_
::
Type
(
_
)
=>
&
mut
seen_type_items
,
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
&
mut
seen_type_items
,
_
=>
&
mut
seen_value_items
,
};
if
!
seen_items
.insert
(
impl_item
.name
)
{
let
desc
=
match
impl_item
.node
{
hir
::
ImplItem
_
::
Const
(
_
,
_
)
=>
"associated constant"
,
hir
::
ImplItem
_
::
Type
(
_
)
=>
"associated type"
,
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
hir
::
ImplItem
Kind
::
Const
(
_
,
_
)
=>
"associated constant"
,
hir
::
ImplItem
Kind
::
Type
(
_
)
=>
"associated type"
,
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
match
sig
.explicit_self.node
{
hir
::
SelfStatic
=>
"associated function"
,
_
=>
"method"
,
...
...
@@ -838,7 +838,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
span_err!
(
tcx
.sess
,
impl_item
.span
,
E0201
,
"duplicate {}"
,
desc
);
}
if
let
hir
::
ImplItem
_
::
Const
(
ref
ty
,
_
)
=
impl_item
.node
{
if
let
hir
::
ImplItem
Kind
::
Const
(
ref
ty
,
_
)
=
impl_item
.node
{
let
ty
=
ccx
.icx
(
&
ty_predicates
)
.to_ty
(
&
ExplicitRscope
,
&*
ty
);
tcx
.register_item_type
(
ccx
.tcx.map
.local_def_id
(
impl_item
.id
),
...
...
@@ -855,7 +855,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
// Convert all the associated types.
for
impl_item
in
impl_items
{
if
let
hir
::
ImplItem
_
::
Type
(
ref
ty
)
=
impl_item
.node
{
if
let
hir
::
ImplItem
Kind
::
Type
(
ref
ty
)
=
impl_item
.node
{
if
opt_trait_ref
.is_none
()
{
span_err!
(
tcx
.sess
,
impl_item
.span
,
E0202
,
"associated types are not allowed in inherent impls"
);
...
...
@@ -870,7 +870,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
}
let
methods
=
impl_items
.iter
()
.filter_map
(|
ii
|
{
if
let
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=
ii
.node
{
if
let
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=
ii
.node
{
// if the method specifies a visibility, use that, otherwise
// inherit the visibility from the impl (so `foo` in `pub impl
// { fn foo(); }` is public, but private in `impl { fn
...
...
@@ -889,7 +889,7 @@ fn convert_item(ccx: &CrateCtxt, it: &hir::Item) {
&
ty_predicates
);
for
impl_item
in
impl_items
{
if
let
hir
::
ImplItem
_
::
Method
(
ref
sig
,
ref
body
)
=
impl_item
.node
{
if
let
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
ref
body
)
=
impl_item
.node
{
let
body_id
=
body
.id
;
check_method_self_type
(
ccx
,
&
BindingRscope
::
new
(),
...
...
src/librustdoc/clean/mod.rs
浏览文件 @
e36872da
...
...
@@ -1271,16 +1271,16 @@ fn clean(&self, cx: &DocContext) -> Item {
impl
Clean
<
Item
>
for
hir
::
ImplItem
{
fn
clean
(
&
self
,
cx
:
&
DocContext
)
->
Item
{
let
inner
=
match
self
.node
{
hir
::
ImplItem
_
::
Const
(
ref
ty
,
ref
expr
)
=>
{
hir
::
ImplItem
Kind
::
Const
(
ref
ty
,
ref
expr
)
=>
{
ConstantItem
(
Constant
{
type_
:
ty
.clean
(
cx
),
expr
:
expr
.span
.to_src
(
cx
),
})
}
hir
::
ImplItem
_
::
Method
(
ref
sig
,
_
)
=>
{
hir
::
ImplItem
Kind
::
Method
(
ref
sig
,
_
)
=>
{
MethodItem
(
sig
.clean
(
cx
))
}
hir
::
ImplItem
_
::
Type
(
ref
ty
)
=>
TypedefItem
(
Typedef
{
hir
::
ImplItem
Kind
::
Type
(
ref
ty
)
=>
TypedefItem
(
Typedef
{
type_
:
ty
.clean
(
cx
),
generics
:
Generics
{
lifetimes
:
Vec
::
new
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录