@@ -677,9 +677,8 @@ impl<'a> AstValidator<'a> {
677
677
Self :: check_decl_no_pat ( & bfty. decl , |span, _, _| {
678
678
self . dcx ( ) . emit_err ( errors:: PatternFnPointer { span } ) ;
679
679
} ) ;
680
- if let Extern :: Implicit ( _) = bfty. ext {
681
- let sig_span = self . sess . source_map ( ) . next_point ( ty. span . shrink_to_lo ( ) ) ;
682
- self . maybe_lint_missing_abi ( sig_span, ty. id ) ;
680
+ if let Extern :: Implicit ( extern_span) = bfty. ext {
681
+ self . maybe_lint_missing_abi ( extern_span, ty. id ) ;
683
682
}
684
683
}
685
684
TyKind :: TraitObject ( bounds, ..) => {
@@ -953,7 +952,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
953
952
walk_list ! ( self , visit_attribute, & item. attrs) ;
954
953
return ; // Avoid visiting again.
955
954
}
956
- ItemKind :: ForeignMod ( ForeignMod { abi, safety, .. } ) => {
955
+ ItemKind :: ForeignMod ( ForeignMod { extern_span , abi, safety, .. } ) => {
957
956
self . with_in_extern_mod ( * safety, |this| {
958
957
let old_item = mem:: replace ( & mut this. extern_mod , Some ( item. span ) ) ;
959
958
this. visibility_not_permitted (
@@ -977,7 +976,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
977
976
}
978
977
979
978
if abi. is_none ( ) {
980
- this. maybe_lint_missing_abi ( item . span , item. id ) ;
979
+ this. maybe_lint_missing_abi ( * extern_span , item. id ) ;
981
980
}
982
981
visit:: walk_item ( this, item) ;
983
982
this. extern_mod = old_item;
@@ -1350,13 +1349,13 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1350
1349
if let FnKind :: Fn (
1351
1350
_,
1352
1351
_,
1353
- FnSig { span : sig_span , header : FnHeader { ext : Extern :: Implicit ( _ ) , .. } , .. } ,
1352
+ FnSig { header : FnHeader { ext : Extern :: Implicit ( extern_span ) , .. } , .. } ,
1354
1353
_,
1355
1354
_,
1356
1355
_,
1357
1356
) = fk
1358
1357
{
1359
- self . maybe_lint_missing_abi ( * sig_span , id) ;
1358
+ self . maybe_lint_missing_abi ( * extern_span , id) ;
1360
1359
}
1361
1360
1362
1361
// Functions without bodies cannot have patterns.
0 commit comments