@@ -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 . maybe_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 maybe_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_rust_2027 ( ) || self . features . explicit_extern_abis ( ) {
717+ self . dcx ( ) . emit_err ( errors:: MissingExternABI { 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. maybe_missing_abi ( * extern_span, item. id ) ;
980982 }
981983 visit:: walk_item ( this, item) ;
982984 this. extern_mod = old_item;
@@ -1356,7 +1358,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13561358 _,
13571359 ) = fk
13581360 {
1359- self . maybe_lint_missing_abi ( * extern_span, id) ;
1361+ self . maybe_missing_abi ( * extern_span, id) ;
13601362 }
13611363
13621364 // Functions without bodies cannot have patterns.
0 commit comments