@@ -677,7 +677,7 @@ impl<'a> AstValidator<'a> {
677
677
self . dcx ( ) . emit_err ( errors:: PatternFnPointer { span } ) ;
678
678
} ) ;
679
679
if let Extern :: Implicit ( extern_span) = bfty. ext {
680
- self . maybe_lint_missing_abi ( extern_span, ty. id ) ;
680
+ self . handle_missing_abi ( extern_span, ty. id ) ;
681
681
}
682
682
}
683
683
TyKind :: TraitObject ( bounds, ..) => {
@@ -710,10 +710,12 @@ impl<'a> AstValidator<'a> {
710
710
}
711
711
}
712
712
713
- fn maybe_lint_missing_abi ( & mut self , span : Span , id : NodeId ) {
713
+ fn handle_missing_abi ( & mut self , span : Span , id : NodeId ) {
714
714
// FIXME(davidtwco): This is a hack to detect macros which produce spans of the
715
715
// call site which do not have a macro backtrace. See #61963.
716
- if self
716
+ if span. edition ( ) . at_least_edition_future ( ) && self . features . explicit_extern_abis ( ) {
717
+ self . dcx ( ) . emit_err ( errors:: MissingAbi { span } ) ;
718
+ } else if self
717
719
. sess
718
720
. source_map ( )
719
721
. span_to_snippet ( span)
@@ -976,7 +978,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
976
978
}
977
979
978
980
if abi. is_none ( ) {
979
- this. maybe_lint_missing_abi ( * extern_span, item. id ) ;
981
+ this. handle_missing_abi ( * extern_span, item. id ) ;
980
982
}
981
983
visit:: walk_item ( this, item) ;
982
984
this. extern_mod = old_item;
@@ -1357,7 +1359,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
1357
1359
} ,
1358
1360
) = fk
1359
1361
{
1360
- self . maybe_lint_missing_abi ( * extern_span, id) ;
1362
+ self . handle_missing_abi ( * extern_span, id) ;
1361
1363
}
1362
1364
1363
1365
// Functions without bodies cannot have patterns.
0 commit comments