@@ -254,6 +254,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
254254 | AttributeKind :: LinkSection { .. }
255255 | AttributeKind :: MacroUse { .. }
256256 | AttributeKind :: MacroEscape ( .. )
257+ | AttributeKind :: NoLink
257258 | AttributeKind :: RustcLayoutScalarValidRangeStart ( ..)
258259 | AttributeKind :: RustcLayoutScalarValidRangeEnd ( ..)
259260 | AttributeKind :: RustcScalableVector { .. }
@@ -303,7 +304,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
303304 self . check_diagnostic_on_const ( attr. span ( ) , hir_id, target, item)
304305 }
305306 [ sym:: thread_local, ..] => self . check_thread_local ( attr, span, target) ,
306- [ sym:: no_link, ..] => self . check_no_link ( hir_id, attr, span, target) ,
307307 [ sym:: rustc_no_implicit_autorefs, ..] => {
308308 self . check_applied_to_fn_or_method ( hir_id, attr. span ( ) , span, target)
309309 }
@@ -457,15 +457,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
457457 self . check_mix_no_mangle_export ( hir_id, attrs) ;
458458 }
459459
460- fn inline_attr_str_error_with_macro_def ( & self , hir_id : HirId , attr_span : Span , sym : & str ) {
461- self . tcx . emit_node_span_lint (
462- UNUSED_ATTRIBUTES ,
463- hir_id,
464- attr_span,
465- errors:: IgnoredAttrWithMacro { sym } ,
466- ) ;
467- }
468-
469460 fn check_eii_impl ( & self , impls : & [ EiiImpl ] , target : Target ) {
470461 for EiiImpl { span, inner_span, eii_macro, impl_marked_unsafe, is_default : _ } in impls {
471462 match target {
@@ -1199,23 +1190,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
11991190 ) ;
12001191 }
12011192
1202- /// Checks if `#[no_link]` is applied to an `extern crate`.
1203- fn check_no_link ( & self , hir_id : HirId , attr : & Attribute , span : Span , target : Target ) {
1204- match target {
1205- Target :: ExternCrate => { }
1206- // FIXME(#80564): We permit struct fields, match arms and macro defs to have an
1207- // `#[no_link]` attribute with just a lint, because we previously
1208- // erroneously allowed it and some crates used it accidentally, to be compatible
1209- // with crates depending on them, we can't throw an error here.
1210- Target :: Field | Target :: Arm | Target :: MacroDef => {
1211- self . inline_attr_str_error_with_macro_def ( hir_id, attr. span ( ) , "no_link" ) ;
1212- }
1213- _ => {
1214- self . dcx ( ) . emit_err ( errors:: NoLink { attr_span : attr. span ( ) , span } ) ;
1215- }
1216- }
1217- }
1218-
12191193 /// Checks if `#[rustc_legacy_const_generics]` is applied to a function and has a valid argument.
12201194 fn check_rustc_legacy_const_generics (
12211195 & self ,
0 commit comments