@@ -1364,7 +1364,6 @@ impl UnreachablePub {
13641364 cx : & LateContext < ' _ > ,
13651365 what : & str ,
13661366 def_id : LocalDefId ,
1367- span : Span ,
13681367 vis_span : Span ,
13691368 exportable : bool ,
13701369 ) {
@@ -1373,7 +1372,7 @@ impl UnreachablePub {
13731372 if vis_span. from_expansion ( ) {
13741373 applicability = Applicability :: MaybeIncorrect ;
13751374 }
1376- let def_span = cx. tcx . sess . source_map ( ) . guess_head_span ( span ) ;
1375+ let def_span = cx. tcx . def_span ( def_id ) ;
13771376 cx. struct_span_lint ( UNREACHABLE_PUB , def_span, |lint| {
13781377 let mut err = lint. build ( fluent:: lint:: builtin_unreachable_pub) ;
13791378 err. set_arg ( "what" , what) ;
@@ -1399,36 +1398,22 @@ impl<'tcx> LateLintPass<'tcx> for UnreachablePub {
13991398 if let hir:: ItemKind :: Use ( _, hir:: UseKind :: ListStem ) = & item. kind {
14001399 return ;
14011400 }
1402- self . perform_lint ( cx, "item" , item. def_id , item. span , item . vis_span , true ) ;
1401+ self . perform_lint ( cx, "item" , item. def_id , item. vis_span , true ) ;
14031402 }
14041403
14051404 fn check_foreign_item ( & mut self , cx : & LateContext < ' _ > , foreign_item : & hir:: ForeignItem < ' tcx > ) {
1406- self . perform_lint (
1407- cx,
1408- "item" ,
1409- foreign_item. def_id ,
1410- foreign_item. span ,
1411- foreign_item. vis_span ,
1412- true ,
1413- ) ;
1405+ self . perform_lint ( cx, "item" , foreign_item. def_id , foreign_item. vis_span , true ) ;
14141406 }
14151407
14161408 fn check_field_def ( & mut self , cx : & LateContext < ' _ > , field : & hir:: FieldDef < ' _ > ) {
14171409 let def_id = cx. tcx . hir ( ) . local_def_id ( field. hir_id ) ;
1418- self . perform_lint ( cx, "field" , def_id, field. span , field . vis_span , false ) ;
1410+ self . perform_lint ( cx, "field" , def_id, field. vis_span , false ) ;
14191411 }
14201412
14211413 fn check_impl_item ( & mut self , cx : & LateContext < ' _ > , impl_item : & hir:: ImplItem < ' _ > ) {
14221414 // Only lint inherent impl items.
14231415 if cx. tcx . associated_item ( impl_item. def_id ) . trait_item_def_id . is_none ( ) {
1424- self . perform_lint (
1425- cx,
1426- "item" ,
1427- impl_item. def_id ,
1428- impl_item. span ,
1429- impl_item. vis_span ,
1430- false ,
1431- ) ;
1416+ self . perform_lint ( cx, "item" , impl_item. def_id , impl_item. vis_span , false ) ;
14321417 }
14331418 }
14341419}
0 commit comments