@@ -677,7 +677,7 @@ impl<'a> AstValidator<'a> {
677677 self . dcx ( ) . emit_err ( errors:: PatternFnPointer { span } ) ;
678678 } ) ;
679679 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 ) ;
681681 }
682682 }
683683 TyKind :: TraitObject ( bounds, ..) => {
@@ -710,10 +710,12 @@ impl<'a> AstValidator<'a> {
710710 }
711711 }
712712
713- fn maybe_lint_missing_abi ( & mut self , span : Span , id : NodeId ) {
713+ fn handle_missing_abi ( & mut self , span : Span , id : NodeId ) {
714714 // FIXME(davidtwco): This is a hack to detect macros which produce spans of the
715715 // 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
717719 . sess
718720 . source_map ( )
719721 . span_to_snippet ( span)
@@ -976,7 +978,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
976978 }
977979
978980 if abi. is_none ( ) {
979- this. maybe_lint_missing_abi ( * extern_span, item. id ) ;
981+ this. handle_missing_abi ( * extern_span, item. id ) ;
980982 }
981983 visit:: walk_item ( this, item) ;
982984 this. extern_mod = old_item;
@@ -1357,7 +1359,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13571359 } ,
13581360 ) = fk
13591361 {
1360- self . maybe_lint_missing_abi ( * extern_span, id) ;
1362+ self . handle_missing_abi ( * extern_span, id) ;
13611363 }
13621364
13631365 // Functions without bodies cannot have patterns.
0 commit comments