@@ -431,13 +431,14 @@ impl DirtyCleanVisitor<'tcx> {
431431 }
432432 }
433433
434- fn check_item ( & mut self , item_id : LocalDefId , item_span : Span ) {
434+ fn check_item ( & mut self , item_id : LocalDefId ) {
435435 for attr in self . tcx . get_attrs ( item_id. to_def_id ( ) ) . iter ( ) {
436436 let assertion = match self . assertion_maybe ( item_id, attr) {
437437 Some ( a) => a,
438438 None => continue ,
439439 } ;
440440 self . checked_attrs . insert ( attr. id ) ;
441+ let item_span = self . tcx . def_span ( item_id) ;
441442 for dep_node in self . dep_nodes ( & assertion. clean , item_id. to_def_id ( ) ) {
442443 self . assert_clean ( item_span, dep_node) ;
443444 }
@@ -450,19 +451,19 @@ impl DirtyCleanVisitor<'tcx> {
450451
451452impl ItemLikeVisitor < ' tcx > for DirtyCleanVisitor < ' tcx > {
452453 fn visit_item ( & mut self , item : & ' tcx hir:: Item < ' tcx > ) {
453- self . check_item ( item. def_id , item . span ) ;
454+ self . check_item ( item. def_id ) ;
454455 }
455456
456457 fn visit_trait_item ( & mut self , item : & hir:: TraitItem < ' _ > ) {
457- self . check_item ( item. def_id , item . span ) ;
458+ self . check_item ( item. def_id ) ;
458459 }
459460
460461 fn visit_impl_item ( & mut self , item : & hir:: ImplItem < ' _ > ) {
461- self . check_item ( item. def_id , item . span ) ;
462+ self . check_item ( item. def_id ) ;
462463 }
463464
464465 fn visit_foreign_item ( & mut self , item : & hir:: ForeignItem < ' _ > ) {
465- self . check_item ( item. def_id , item . span ) ;
466+ self . check_item ( item. def_id ) ;
466467 }
467468}
468469
0 commit comments