Skip to content

Commit e36872d

Browse files
committed
ImplItem_ -> ImplItemKind rename
1 parent eaaa60d commit e36872d

File tree

30 files changed

+99
-99
lines changed

30 files changed

+99
-99
lines changed

src/librustc/front/map/collector.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
224224

225225
fn visit_impl_item(&mut self, ii: &'ast ImplItem) {
226226
let def_data = match ii.node {
227-
ImplItem_::Method(..) | ImplItem_::Const(..) => DefPathData::Value(ii.name),
228-
ImplItem_::Type(..) => DefPathData::Type(ii.name),
227+
ImplItemKind::Method(..) | ImplItemKind::Const(..) => DefPathData::Value(ii.name),
228+
ImplItemKind::Type(..) => DefPathData::Type(ii.name),
229229
};
230230

231231
self.insert_def(ii.id, NodeImplItem(ii), def_data);
@@ -234,7 +234,7 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
234234
self.parent_node = ii.id;
235235

236236
match ii.node {
237-
ImplItem_::Const(_, ref expr) => {
237+
ImplItemKind::Const(_, ref expr) => {
238238
self.create_def(expr.id, DefPathData::Initializer);
239239
}
240240
_ => { }

src/librustc/front/map/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,18 +937,18 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
937937
}
938938
Some(NodeImplItem(ii)) => {
939939
match ii.node {
940-
ImplItem_::Const(..) => {
940+
ImplItemKind::Const(..) => {
941941
format!("assoc const {} in {}{}",
942942
ii.name,
943943
map.path_to_string(id),
944944
id_str)
945945
}
946-
ImplItem_::Method(..) => {
946+
ImplItemKind::Method(..) => {
947947
format!("method {} in {}{}",
948948
ii.name,
949949
map.path_to_string(id), id_str)
950950
}
951-
ImplItem_::Type(_) => {
951+
ImplItemKind::Type(_) => {
952952
format!("assoc type {} in {}{}",
953953
ii.name,
954954
map.path_to_string(id),

src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ fn encode_info_for_method<'a, 'tcx>(ecx: &EncodeContext<'a, 'tcx>,
739739
let elem = ast_map::PathName(m.name);
740740
encode_path(rbml_w, impl_path.chain(Some(elem)));
741741
if let Some(impl_item) = impl_item_opt {
742-
if let hir::ImplItem_::Method(ref sig, _) = impl_item.node {
742+
if let hir::ImplItemKind::Method(ref sig, _) = impl_item.node {
743743
encode_attributes(rbml_w, &impl_item.attrs);
744744
let scheme = ecx.tcx.lookup_item_type(m.def_id);
745745
let any_types = !scheme.generics.types.is_empty();

src/librustc/middle/check_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
348348

349349
fn visit_impl_item(&mut self, i: &'v hir::ImplItem) {
350350
match i.node {
351-
hir::ImplItem_::Const(_, ref expr) => {
351+
hir::ImplItemKind::Const(_, ref expr) => {
352352
self.global_expr(Mode::Const, &*expr);
353353
}
354354
_ => self.with_mode(Mode::Var, |v| visit::walk_impl_item(v, i)),

src/librustc/middle/check_static_recursion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a, 'ast: 'a> Visitor<'ast> for CheckCrateVisitor<'a, 'ast> {
7979

8080
fn visit_impl_item(&mut self, ii: &'ast hir::ImplItem) {
8181
match ii.node {
82-
hir::ImplItem_::Const(..) => {
82+
hir::ImplItemKind::Const(..) => {
8383
let mut recursion_visitor =
8484
CheckItemRecursionVisitor::new(self, &ii.span);
8585
recursion_visitor.visit_impl_item(ii);

src/librustc/middle/const_eval.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: &'a ty::ctxt<'tcx>,
129129
_ => None
130130
},
131131
Some(ast_map::NodeImplItem(ii)) => match ii.node {
132-
hir::ImplItem_::Const(_, ref expr) => {
132+
hir::ImplItemKind::Const(_, ref expr) => {
133133
Some(&*expr)
134134
}
135135
_ => None
@@ -171,7 +171,7 @@ pub fn lookup_const_by_id<'a, 'tcx: 'a>(tcx: &'a ty::ctxt<'tcx>,
171171
_ => None
172172
},
173173
csearch::FoundAst::Found(&InlinedItem::ImplItem(_, ref ii)) => match ii.node {
174-
hir::ImplItem_::Const(_, ref expr) => Some(expr.id),
174+
hir::ImplItemKind::Const(_, ref expr) => Some(expr.id),
175175
_ => None
176176
},
177177
_ => None
@@ -996,7 +996,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &ty::ctxt<'tcx>,
996996
},
997997
ty::ImplContainer(_) => match tcx.map.find(node_id) {
998998
Some(ast_map::NodeImplItem(ii)) => match ii.node {
999-
hir::ImplItem_::Const(ref ty, ref expr) => {
999+
hir::ImplItemKind::Const(ref ty, ref expr) => {
10001000
(Some(&**expr), Some(&**ty))
10011001
}
10021002
_ => (None, None)

src/librustc/middle/dead.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,14 @@ impl<'v> Visitor<'v> for LifeSeeder {
358358
hir::ItemImpl(_, _, _, ref opt_trait, _, ref impl_items) => {
359359
for impl_item in impl_items {
360360
match impl_item.node {
361-
hir::ImplItem_::Const(..) |
362-
hir::ImplItem_::Method(..) => {
361+
hir::ImplItemKind::Const(..) |
362+
hir::ImplItemKind::Method(..) => {
363363
if opt_trait.is_some() ||
364364
has_allow_dead_code_or_lang_attr(&impl_item.attrs) {
365365
self.worklist.push(impl_item.id);
366366
}
367367
}
368-
hir::ImplItem_::Type(_) => {}
368+
hir::ImplItemKind::Type(_) => {}
369369
}
370370
}
371371
}
@@ -571,21 +571,21 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DeadVisitor<'a, 'tcx> {
571571

572572
fn visit_impl_item(&mut self, impl_item: &hir::ImplItem) {
573573
match impl_item.node {
574-
hir::ImplItem_::Const(_, ref expr) => {
574+
hir::ImplItemKind::Const(_, ref expr) => {
575575
if !self.symbol_is_live(impl_item.id, None) {
576576
self.warn_dead_code(impl_item.id, impl_item.span,
577577
impl_item.name, "associated const");
578578
}
579579
visit::walk_expr(self, expr)
580580
}
581-
hir::ImplItem_::Method(_, ref body) => {
581+
hir::ImplItemKind::Method(_, ref body) => {
582582
if !self.symbol_is_live(impl_item.id, None) {
583583
self.warn_dead_code(impl_item.id, impl_item.span,
584584
impl_item.name, "method");
585585
}
586586
visit::walk_block(self, body)
587587
}
588-
hir::ImplItem_::Type(..) => {}
588+
hir::ImplItemKind::Type(..) => {}
589589
}
590590
}
591591

src/librustc/middle/infer/error_reporting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
948948
}
949949
ast_map::NodeImplItem(item) => {
950950
match item.node {
951-
hir::ImplItem_::Method(ref sig, _) => {
951+
hir::ImplItemKind::Method(ref sig, _) => {
952952
Some((&sig.decl,
953953
&sig.generics,
954954
sig.unsafety,
@@ -1839,7 +1839,7 @@ fn lifetimes_in_scope(tcx: &ty::ctxt,
18391839
},
18401840
ast_map::NodeImplItem(ii) => {
18411841
match ii.node {
1842-
hir::ImplItem_::Method(ref sig, _) => {
1842+
hir::ImplItemKind::Method(ref sig, _) => {
18431843
taken.push_all(&sig.generics.lifetimes);
18441844
Some(ii.id)
18451845
}

src/librustc/middle/reachable.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
185185
}
186186
Some(ast_map::NodeImplItem(impl_item)) => {
187187
match impl_item.node {
188-
hir::ImplItem_::Const(..) => true,
189-
hir::ImplItem_::Method(ref sig, _) => {
188+
hir::ImplItemKind::Const(..) => true,
189+
hir::ImplItemKind::Method(ref sig, _) => {
190190
if generics_require_inlining(&sig.generics) ||
191191
attr::requests_inline(&impl_item.attrs) {
192192
true
@@ -206,7 +206,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
206206
}
207207
}
208208
}
209-
hir::ImplItem_::Type(_) => false,
209+
hir::ImplItemKind::Type(_) => false,
210210
}
211211
}
212212
Some(_) => false,
@@ -299,16 +299,16 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
299299
}
300300
ast_map::NodeImplItem(impl_item) => {
301301
match impl_item.node {
302-
hir::ImplItem_::Const(_, ref expr) => {
302+
hir::ImplItemKind::Const(_, ref expr) => {
303303
self.visit_expr(&*expr);
304304
}
305-
hir::ImplItem_::Method(ref sig, ref body) => {
305+
hir::ImplItemKind::Method(ref sig, ref body) => {
306306
let did = self.tcx.map.get_parent_did(search_item);
307307
if method_might_be_inlined(self.tcx, sig, impl_item, did) {
308308
visit::walk_block(self, body)
309309
}
310310
}
311-
hir::ImplItem_::Type(_) => {}
311+
hir::ImplItemKind::Type(_) => {}
312312
}
313313
}
314314
// Nothing to recurse on for these

src/librustc/middle/ty/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
11241124
match cx.map.find(id) {
11251125
Some(ast_map::NodeImplItem(ref impl_item)) => {
11261126
match impl_item.node {
1127-
hir::ImplItem_::Type(_) => {
1127+
hir::ImplItemKind::Type(_) => {
11281128
// associated types don't have their own entry (for some reason),
11291129
// so for now just grab environment for the impl
11301130
let impl_id = cx.map.get_parent(id);
@@ -1136,7 +1136,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
11361136
&predicates,
11371137
id)
11381138
}
1139-
hir::ImplItem_::Const(_, _) => {
1139+
hir::ImplItemKind::Const(_, _) => {
11401140
let def_id = cx.map.local_def_id(id);
11411141
let scheme = cx.lookup_item_type(def_id);
11421142
let predicates = cx.lookup_predicates(def_id);
@@ -1145,7 +1145,7 @@ impl<'a, 'tcx> ParameterEnvironment<'a, 'tcx> {
11451145
&predicates,
11461146
id)
11471147
}
1148-
hir::ImplItem_::Method(_, ref body) => {
1148+
hir::ImplItemKind::Method(_, ref body) => {
11491149
let method_def_id = cx.map.local_def_id(id);
11501150
match cx.impl_or_trait_item(method_def_id) {
11511151
MethodTraitItem(ref method_ty) => {
@@ -2158,7 +2158,7 @@ impl<'tcx> ctxt<'tcx> {
21582158
}
21592159
ItemImpl(_, _, _, _, _, ref iis) => {
21602160
iis.iter().filter_map(|ii| {
2161-
if let hir::ImplItem_::Const(_, _) = ii.node {
2161+
if let hir::ImplItemKind::Const(_, _) = ii.node {
21622162
match self.impl_or_trait_item(self.map.local_def_id(ii.id)) {
21632163
ConstTraitItem(ac) => Some(ac),
21642164
_ => {

0 commit comments

Comments
 (0)