@@ -684,7 +684,7 @@ impl<'a> AstValidator<'a> {
684684 self . dcx ( ) . emit_err ( errors:: PatternFnPointer { span } ) ;
685685 } ) ;
686686 if let Extern :: Implicit ( extern_span) = bfty. ext {
687- self . maybe_lint_missing_abi ( extern_span, ty. id ) ;
687+ self . handle_missing_abi ( extern_span, ty. id ) ;
688688 }
689689 }
690690 TyKind :: TraitObject ( bounds, ..) => {
@@ -717,10 +717,12 @@ impl<'a> AstValidator<'a> {
717717 }
718718 }
719719
720- fn maybe_lint_missing_abi ( & mut self , span : Span , id : NodeId ) {
720+ fn handle_missing_abi ( & mut self , span : Span , id : NodeId ) {
721721 // FIXME(davidtwco): This is a hack to detect macros which produce spans of the
722722 // call site which do not have a macro backtrace. See #61963.
723- if self
723+ if span. edition ( ) . at_least_edition_future ( ) && self . features . explicit_extern_abis ( ) {
724+ self . dcx ( ) . emit_err ( errors:: MissingAbi { span } ) ;
725+ } else if self
724726 . sess
725727 . source_map ( )
726728 . span_to_snippet ( span)
@@ -996,7 +998,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
996998 }
997999
9981000 if abi. is_none ( ) {
999- self . maybe_lint_missing_abi ( * extern_span, item. id ) ;
1001+ self . handle_missing_abi ( * extern_span, item. id ) ;
10001002 }
10011003 self . with_in_extern_mod ( * safety, |this| {
10021004 visit:: walk_item ( this, item) ;
@@ -1370,7 +1372,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
13701372 } ,
13711373 ) = fk
13721374 {
1373- self . maybe_lint_missing_abi ( * extern_span, id) ;
1375+ self . handle_missing_abi ( * extern_span, id) ;
13741376 }
13751377
13761378 // Functions without bodies cannot have patterns.
0 commit comments