@@ -1185,8 +1185,7 @@ fn find_existential_constraints<'a, 'tcx>(
11851185 found : Option < ( Span , ty:: Ty < ' tcx > ) > ,
11861186 }
11871187 impl < ' a , ' tcx > ConstraintLocator < ' a , ' tcx > {
1188- fn check ( & mut self , node_id : ast:: NodeId ) {
1189- let def_id = self . tcx . hir . local_def_id ( node_id) ;
1188+ fn check ( & mut self , def_id : DefId ) {
11901189 // don't try to check items that cannot possibly constrain the type
11911190 if !self . tcx . has_typeck_tables ( def_id) {
11921191 return ;
@@ -1221,21 +1220,24 @@ fn find_existential_constraints<'a, 'tcx>(
12211220 intravisit:: NestedVisitorMap :: All ( & self . tcx . hir )
12221221 }
12231222 fn visit_item ( & mut self , it : & ' tcx Item ) {
1223+ let def_id = self . tcx . hir . local_def_id ( it. id ) ;
12241224 // the existential type itself or its children are not within its reveal scope
1225- if self . tcx . hir . local_def_id ( it . id ) != self . def_id {
1226- self . check ( it . id ) ;
1225+ if def_id != self . def_id {
1226+ self . check ( def_id ) ;
12271227 intravisit:: walk_item ( self , it) ;
12281228 }
12291229 }
12301230 fn visit_impl_item ( & mut self , it : & ' tcx ImplItem ) {
1231+ let def_id = self . tcx . hir . local_def_id ( it. id ) ;
12311232 // the existential type itself or its children are not within its reveal scope
1232- if self . tcx . hir . local_def_id ( it . id ) != self . def_id {
1233- self . check ( it . id ) ;
1233+ if def_id != self . def_id {
1234+ self . check ( def_id ) ;
12341235 intravisit:: walk_impl_item ( self , it) ;
12351236 }
12361237 }
12371238 fn visit_trait_item ( & mut self , it : & ' tcx TraitItem ) {
1238- self . check ( it. id ) ;
1239+ let def_id = self . tcx . hir . local_def_id ( it. id ) ;
1240+ self . check ( def_id) ;
12391241 intravisit:: walk_trait_item ( self , it) ;
12401242 }
12411243 }
0 commit comments