@@ -250,6 +250,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
250250 | AttributeKind :: LinkSection { .. }
251251 | AttributeKind :: MacroUse { .. }
252252 | AttributeKind :: MacroEscape ( .. )
253+ | AttributeKind :: NoLink
253254 | AttributeKind :: RustcLayoutScalarValidRangeStart ( ..)
254255 | AttributeKind :: RustcLayoutScalarValidRangeEnd ( ..)
255256 | AttributeKind :: RustcScalableVector { .. }
@@ -299,7 +300,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
299300 self . check_diagnostic_on_const ( attr. span ( ) , hir_id, target, item)
300301 }
301302 [ sym:: thread_local, ..] => self . check_thread_local ( attr, span, target) ,
302- [ sym:: no_link, ..] => self . check_no_link ( hir_id, attr, span, target) ,
303303 [ sym:: rustc_no_implicit_autorefs, ..] => {
304304 self . check_applied_to_fn_or_method ( hir_id, attr. span ( ) , span, target)
305305 }
@@ -456,15 +456,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
456456 self . check_mix_no_mangle_export ( hir_id, attrs) ;
457457 }
458458
459- fn inline_attr_str_error_with_macro_def ( & self , hir_id : HirId , attr_span : Span , sym : & str ) {
460- self . tcx . emit_node_span_lint (
461- UNUSED_ATTRIBUTES ,
462- hir_id,
463- attr_span,
464- errors:: IgnoredAttrWithMacro { sym } ,
465- ) ;
466- }
467-
468459 fn check_eii_impl ( & self , impls : & [ EiiImpl ] , target : Target ) {
469460 for EiiImpl { span, inner_span, eii_macro, impl_marked_unsafe, is_default : _ } in impls {
470461 match target {
@@ -1198,23 +1189,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
11981189 ) ;
11991190 }
12001191
1201- /// Checks if `#[no_link]` is applied to an `extern crate`.
1202- fn check_no_link ( & self , hir_id : HirId , attr : & Attribute , span : Span , target : Target ) {
1203- match target {
1204- Target :: ExternCrate => { }
1205- // FIXME(#80564): We permit struct fields, match arms and macro defs to have an
1206- // `#[no_link]` attribute with just a lint, because we previously
1207- // erroneously allowed it and some crates used it accidentally, to be compatible
1208- // with crates depending on them, we can't throw an error here.
1209- Target :: Field | Target :: Arm | Target :: MacroDef => {
1210- self . inline_attr_str_error_with_macro_def ( hir_id, attr. span ( ) , "no_link" ) ;
1211- }
1212- _ => {
1213- self . dcx ( ) . emit_err ( errors:: NoLink { attr_span : attr. span ( ) , span } ) ;
1214- }
1215- }
1216- }
1217-
12181192 /// Checks if `#[rustc_legacy_const_generics]` is applied to a function and has a valid argument.
12191193 fn check_rustc_legacy_const_generics (
12201194 & self ,
0 commit comments