@@ -40,7 +40,6 @@ use rustc_middle::traits::ObligationCause;
4040use rustc_middle:: ty:: error:: { ExpectedFound , TypeError } ;
4141use rustc_middle:: ty:: { self , TyCtxt , TypingMode , Unnormalized } ;
4242use rustc_middle:: { bug, span_bug} ;
43- use rustc_session:: diagnostics:: feature_err;
4443use rustc_span:: edition:: Edition ;
4544use rustc_span:: { DUMMY_SP , Ident , Span , Symbol , kw, sym} ;
4645use rustc_structures:: CrateType ;
@@ -207,7 +206,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
207206 AttributeKind :: RustcAllowConstFnUnstable ( _, first_span) => {
208207 self . check_rustc_allow_const_fn_unstable ( hir_id, * first_span, span, target)
209208 }
210- AttributeKind :: Naked ( ..) => self . check_naked ( hir_id, target) ,
211209 AttributeKind :: NonExhaustive ( attr_span) => {
212210 self . check_non_exhaustive ( * attr_span, span, target, item)
213211 }
@@ -284,6 +282,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
284282 AttributeKind :: MoveSizeLimit { .. } => ( ) ,
285283 AttributeKind :: MustNotSupend { .. } => ( ) ,
286284 AttributeKind :: MustUse { .. } => ( ) ,
285+ AttributeKind :: Naked ( ..) => ( ) ,
287286 AttributeKind :: NeedsAllocator => ( ) ,
288287 AttributeKind :: NeedsPanicRuntime => ( ) ,
289288 AttributeKind :: NoBuiltins => ( ) ,
@@ -771,32 +770,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
771770 }
772771 }
773772
774- /// Checks if `#[naked]` is applied to a function definition.
775- fn check_naked ( & self , hir_id : HirId , target : Target ) {
776- match target {
777- Target :: Fn
778- | Target :: Method (
779- MethodKind :: Trait { body : true } | MethodKind :: TraitImpl | MethodKind :: Inherent ,
780- ) => {
781- let fn_sig = self . tcx . hir_node ( hir_id) . fn_sig ( ) . unwrap ( ) ;
782- let abi = fn_sig. header . abi ;
783- if abi. is_rustic_abi ( ) && !self . tcx . features ( ) . naked_functions_rustic_abi ( ) {
784- feature_err (
785- & self . tcx . sess ,
786- sym:: naked_functions_rustic_abi,
787- fn_sig. span ,
788- format ! (
789- "`#[naked]` is currently unstable on `extern \" {}\" ` functions" ,
790- abi. as_str( )
791- ) ,
792- )
793- . emit ( ) ;
794- }
795- }
796- _ => { }
797- }
798- }
799-
800773 /// Checks if the `#[non_exhaustive]` attribute on an `item` is valid.
801774 fn check_non_exhaustive (
802775 & self ,
0 commit comments