@@ -431,13 +431,14 @@ impl DirtyCleanVisitor<'tcx> {
431
431
}
432
432
}
433
433
434
- fn check_item ( & mut self , item_id : LocalDefId , item_span : Span ) {
434
+ fn check_item ( & mut self , item_id : LocalDefId ) {
435
435
for attr in self . tcx . get_attrs ( item_id. to_def_id ( ) ) . iter ( ) {
436
436
let assertion = match self . assertion_maybe ( item_id, attr) {
437
437
Some ( a) => a,
438
438
None => continue ,
439
439
} ;
440
440
self . checked_attrs . insert ( attr. id ) ;
441
+ let item_span = self . tcx . def_span ( item_id) ;
441
442
for dep_node in self . dep_nodes ( & assertion. clean , item_id. to_def_id ( ) ) {
442
443
self . assert_clean ( item_span, dep_node) ;
443
444
}
@@ -450,19 +451,19 @@ impl DirtyCleanVisitor<'tcx> {
450
451
451
452
impl ItemLikeVisitor < ' tcx > for DirtyCleanVisitor < ' tcx > {
452
453
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 ) ;
454
455
}
455
456
456
457
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 ) ;
458
459
}
459
460
460
461
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 ) ;
462
463
}
463
464
464
465
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 ) ;
466
467
}
467
468
}
468
469
0 commit comments