From 671751469491749594e69231ef1feabf4a5102b0 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Fri, 23 Oct 2026 13:12:04 +0200 Subject: [PATCH 1/2] Error on wrong targets for `no_mangle` and `export_name` --- .../src/attributes/codegen_attrs.rs | 8 +- tests/codegen-llvm/issues/issue-32031.rs | 2 - tests/ui/attributes/attr-on-mac-call.rs | 6 +- tests/ui/attributes/attr-on-mac-call.stderr | 122 +++--- tests/ui/extern/extern-no-mangle.rs | 11 +- tests/ui/extern/extern-no-mangle.stderr | 26 +- ...sue-43106-gating-of-builtin-attrs-error.rs | 30 +- ...43106-gating-of-builtin-attrs-error.stderr | 135 +++++-- .../issue-43106-gating-of-builtin-attrs.rs | 47 --- ...issue-43106-gating-of-builtin-attrs.stderr | 363 ++++++++---------- .../param-attrs-builtin-attrs.rs | 30 +- .../param-attrs-builtin-attrs.stderr | 270 +++++++------ 12 files changed, 493 insertions(+), 557 deletions(-) diff --git a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs index bd30983cd69d4..cd281c32ac3a9 100644 --- a/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs +++ b/compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs @@ -120,12 +120,7 @@ impl SingleAttributeParser for ExportNameParser { Allow(Target::Static), Allow(Target::Fn), Allow(Target::Method(MethodKind::Inherent)), - Allow(Target::Method(MethodKind::Trait { body: true })), Allow(Target::Method(MethodKind::TraitImpl)), - Warn(Target::Field), - Warn(Target::Arm), - Warn(Target::MacroDef), - Warn(Target::MacroCall), ]); const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name"); const STABILITY: AttributeStability = AttributeStability::Stable; @@ -386,13 +381,12 @@ impl NoArgsAttributeParser for NoMangleParser { note: "the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them", unsafe_since: Some(Edition2024), }; - const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[ + const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[ Allow(Target::Fn), Allow(Target::Static), Allow(Target::Method(MethodKind::Inherent)), Allow(Target::Method(MethodKind::TraitImpl)), AllowSilent(Target::Const), // Handled in the `InvalidNoMangleItems` pass - Error(Target::Closure), ]); const STABILITY: AttributeStability = AttributeStability::Stable; const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoMangle; diff --git a/tests/codegen-llvm/issues/issue-32031.rs b/tests/codegen-llvm/issues/issue-32031.rs index 559e8d947fba5..763b527c73570 100644 --- a/tests/codegen-llvm/issues/issue-32031.rs +++ b/tests/codegen-llvm/issues/issue-32031.rs @@ -6,7 +6,6 @@ #![crate_type = "lib"] -#[no_mangle] pub struct F32(f32); // other: define{{.*}}float @add_newtype_f32(float %a, float %b) @@ -17,7 +16,6 @@ pub fn add_newtype_f32(a: F32, b: F32) -> F32 { F32(a.0 + b.0) } -#[no_mangle] pub struct F64(f64); // other: define{{.*}}double @add_newtype_f64(double %a, double %b) diff --git a/tests/ui/attributes/attr-on-mac-call.rs b/tests/ui/attributes/attr-on-mac-call.rs index 28fbd0ca48600..0392a8f71371f 100644 --- a/tests/ui/attributes/attr-on-mac-call.rs +++ b/tests/ui/attributes/attr-on-mac-call.rs @@ -6,8 +6,7 @@ fn main() { #[export_name = "x"] - //~^ WARN attribute cannot be used on macro calls - //~| WARN previously accepted + //~^ ERROR attribute cannot be used on macro calls #[unsafe(naked)] //~^ WARN attribute cannot be used on macro calls //~| WARN previously accepted @@ -45,8 +44,7 @@ fn main() { //~^ WARN attribute cannot be used on macro calls //~| WARN previously accepted #[no_mangle] - //~^ WARN attribute cannot be used on macro calls - //~| WARN previously accepted + //~^ ERROR attribute cannot be used on macro calls #[deprecated] //~^ WARN attribute cannot be used on macro calls //~| WARN previously accepted diff --git a/tests/ui/attributes/attr-on-mac-call.stderr b/tests/ui/attributes/attr-on-mac-call.stderr index b1b4112e27e2b..d2d801ed48cc9 100644 --- a/tests/ui/attributes/attr-on-mac-call.stderr +++ b/tests/ui/attributes/attr-on-mac-call.stderr @@ -1,5 +1,23 @@ +error: the `export_name` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:8:7 + | +LL | #[export_name = "x"] + | ^^^^^^^^^^^ + | + = help: the `export_name` attribute can be applied to functions and statics + = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute + +error: the `no_mangle` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:46:7 + | +LL | #[no_mangle] + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute + error: the `sanitize` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:77:7 + --> $DIR/attr-on-mac-call.rs:75:7 | LL | #[sanitize(address = "off")] | ^^^^^^^^ @@ -8,7 +26,7 @@ LL | #[sanitize(address = "off")] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute error[E0658]: SIMD types are experimental and possibly buggy - --> $DIR/attr-on-mac-call.rs:106:12 + --> $DIR/attr-on-mac-call.rs:104:12 | LL | #[repr(simd)] | ^^^^ @@ -18,7 +36,7 @@ LL | #[repr(simd)] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: the `repr(simd)` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:106:7 + --> $DIR/attr-on-mac-call.rs:104:7 | LL | #[repr(simd)] | ^^^^^^^^^^ @@ -27,31 +45,31 @@ LL | #[repr(simd)] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute error: crate-level attribute should be an inner attribute: add an exclamation mark: `#![register_tool]` - --> $DIR/attr-on-mac-call.rs:110:5 + --> $DIR/attr-on-mac-call.rs:108:5 | LL | #[register_tool(xyz)] | ^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this macro call - --> $DIR/attr-on-mac-call.rs:112:5 + --> $DIR/attr-on-mac-call.rs:110:5 | LL | unreachable!(); | ^^^^^^^^^^^^^^ error: attribute value must be a literal - --> $DIR/attr-on-mac-call.rs:113:20 + --> $DIR/attr-on-mac-call.rs:111:20 | LL | #[deprecated = concat!("woah", "dude")] | ^^^^^^^^^^^^^^^^^^^^^^^ error: attribute value must be a literal - --> $DIR/attr-on-mac-call.rs:115:13 + --> $DIR/attr-on-mac-call.rs:113:13 | LL | #[doc = concat!("woah", "dude")] | ^^^^^^^^^^^^^^^^^^^^^^^ error: attribute value must be a literal - --> $DIR/attr-on-mac-call.rs:118:13 + --> $DIR/attr-on-mac-call.rs:116:13 | LL | #[doc = { | _____________^ @@ -63,7 +81,7 @@ LL | | }] | |_____^ error: attribute value must be a literal - --> $DIR/attr-on-mac-call.rs:126:13 + --> $DIR/attr-on-mac-call.rs:124:13 | LL | #[doc = { | _____________^ @@ -71,13 +89,13 @@ LL | | let expressions @ r#in @ doc @ attributes @ at = home; LL | | }] | |_____^ -warning: the `export_name` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:8:7 +warning: the `naked` attribute cannot be used on macro calls + --> $DIR/attr-on-mac-call.rs:10:14 | -LL | #[export_name = "x"] - | ^^^^^^^^^^^ +LL | #[unsafe(naked)] + | ^^^^^ | - = help: the `export_name` attribute can be applied to functions and statics + = help: the `naked` attribute can only be applied to functions = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute note: the lint level is defined here @@ -86,18 +104,8 @@ note: the lint level is defined here LL | #![warn(unused_attributes)] | ^^^^^^^^^^^^^^^^^ -warning: the `naked` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:11:14 - | -LL | #[unsafe(naked)] - | ^^^^^ - | - = help: the `naked` attribute can only be applied to functions - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute - warning: the `track_caller` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:14:7 + --> $DIR/attr-on-mac-call.rs:13:7 | LL | #[track_caller] | ^^^^^^^^^^^^ @@ -107,7 +115,7 @@ LL | #[track_caller] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `used` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:17:7 + --> $DIR/attr-on-mac-call.rs:16:7 | LL | #[used] | ^^^^ @@ -117,7 +125,7 @@ LL | #[used] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `target_feature` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:20:7 + --> $DIR/attr-on-mac-call.rs:19:7 | LL | #[target_feature(enable = "x")] | ^^^^^^^^^^^^^^ @@ -127,7 +135,7 @@ LL | #[target_feature(enable = "x")] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `deprecated` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:23:7 + --> $DIR/attr-on-mac-call.rs:22:7 | LL | #[deprecated] | ^^^^^^^^^^ @@ -137,7 +145,7 @@ LL | #[deprecated] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `inline` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:26:7 + --> $DIR/attr-on-mac-call.rs:25:7 | LL | #[inline] | ^^^^^^ @@ -147,7 +155,7 @@ LL | #[inline] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `link_name` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:29:7 + --> $DIR/attr-on-mac-call.rs:28:7 | LL | #[link_name = "x"] | ^^^^^^^^^ @@ -157,7 +165,7 @@ LL | #[link_name = "x"] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `link_section` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:32:7 + --> $DIR/attr-on-mac-call.rs:31:7 | LL | #[link_section = "__TEXT,__text"] | ^^^^^^^^^^^^ @@ -167,7 +175,7 @@ LL | #[link_section = "__TEXT,__text"] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `link_ordinal` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:35:7 + --> $DIR/attr-on-mac-call.rs:34:7 | LL | #[link_ordinal(42)] | ^^^^^^^^^^^^ @@ -177,7 +185,7 @@ LL | #[link_ordinal(42)] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `non_exhaustive` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:38:7 + --> $DIR/attr-on-mac-call.rs:37:7 | LL | #[non_exhaustive] | ^^^^^^^^^^^^^^ @@ -187,7 +195,7 @@ LL | #[non_exhaustive] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `proc_macro` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:41:7 + --> $DIR/attr-on-mac-call.rs:40:7 | LL | #[proc_macro] | ^^^^^^^^^^ @@ -197,7 +205,7 @@ LL | #[proc_macro] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `cold` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:44:7 + --> $DIR/attr-on-mac-call.rs:43:7 | LL | #[cold] | ^^^^ @@ -206,18 +214,8 @@ LL | #[cold] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -warning: the `no_mangle` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:47:7 - | -LL | #[no_mangle] - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute - warning: the `deprecated` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:50:7 + --> $DIR/attr-on-mac-call.rs:48:7 | LL | #[deprecated] | ^^^^^^^^^^ @@ -227,7 +225,7 @@ LL | #[deprecated] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `automatically_derived` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:53:7 + --> $DIR/attr-on-mac-call.rs:51:7 | LL | #[automatically_derived] | ^^^^^^^^^^^^^^^^^^^^^ @@ -237,7 +235,7 @@ LL | #[automatically_derived] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `macro_use` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:56:7 + --> $DIR/attr-on-mac-call.rs:54:7 | LL | #[macro_use] | ^^^^^^^^^ @@ -247,7 +245,7 @@ LL | #[macro_use] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `must_use` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:59:7 + --> $DIR/attr-on-mac-call.rs:57:7 | LL | #[must_use] | ^^^^^^^^ @@ -257,7 +255,7 @@ LL | #[must_use] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `no_implicit_prelude` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:62:7 + --> $DIR/attr-on-mac-call.rs:60:7 | LL | #[no_implicit_prelude] | ^^^^^^^^^^^^^^^^^^^ @@ -267,7 +265,7 @@ LL | #[no_implicit_prelude] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `path` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:65:7 + --> $DIR/attr-on-mac-call.rs:63:7 | LL | #[path = ""] | ^^^^ @@ -277,7 +275,7 @@ LL | #[path = ""] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `ignore` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:68:7 + --> $DIR/attr-on-mac-call.rs:66:7 | LL | #[ignore] | ^^^^^^ @@ -287,7 +285,7 @@ LL | #[ignore] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `should_panic` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:71:7 + --> $DIR/attr-on-mac-call.rs:69:7 | LL | #[should_panic] | ^^^^^^^^^^^^ @@ -297,7 +295,7 @@ LL | #[should_panic] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `link_name` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:74:7 + --> $DIR/attr-on-mac-call.rs:72:7 | LL | #[link_name = "x"] | ^^^^^^^^^ @@ -307,7 +305,7 @@ LL | #[link_name = "x"] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `repr()` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:81:7 + --> $DIR/attr-on-mac-call.rs:79:7 | LL | #[repr()] | ^^^^^^ @@ -317,7 +315,7 @@ LL | #[repr()] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: unused attribute - --> $DIR/attr-on-mac-call.rs:81:5 + --> $DIR/attr-on-mac-call.rs:79:5 | LL | #[repr()] | ^^^^^^^^^ help: remove this attribute @@ -325,7 +323,7 @@ LL | #[repr()] = note: using `repr` with an empty list has no effect warning: the `repr(u8)` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:86:7 + --> $DIR/attr-on-mac-call.rs:84:7 | LL | #[repr(u8)] | ^^^^^^^^ @@ -335,7 +333,7 @@ LL | #[repr(u8)] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `repr(align(...))` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:90:7 + --> $DIR/attr-on-mac-call.rs:88:7 | LL | #[repr(align(8))] | ^^^^^^^^^^^^^^ @@ -345,7 +343,7 @@ LL | #[repr(align(8))] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `repr(packed)` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:94:7 + --> $DIR/attr-on-mac-call.rs:92:7 | LL | #[repr(packed)] | ^^^^^^^^^^^^ @@ -355,7 +353,7 @@ LL | #[repr(packed)] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `repr(C)` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:98:7 + --> $DIR/attr-on-mac-call.rs:96:7 | LL | #[repr(C)] | ^^^^^^^ @@ -365,7 +363,7 @@ LL | #[repr(C)] = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute warning: the `repr(Rust)` attribute cannot be used on macro calls - --> $DIR/attr-on-mac-call.rs:102:7 + --> $DIR/attr-on-mac-call.rs:100:7 | LL | #[repr(Rust)] | ^^^^^^^^^^ @@ -374,6 +372,6 @@ LL | #[repr(Rust)] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: placing this attribute on a macro invocation does nothing even if the macro expands to what would be a valid target for the attribute -error: aborting due to 8 previous errors; 30 warnings emitted +error: aborting due to 10 previous errors; 28 warnings emitted For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/extern/extern-no-mangle.rs b/tests/ui/extern/extern-no-mangle.rs index 6f2d125b92306..fc26603a4e2cc 100644 --- a/tests/ui/extern/extern-no-mangle.rs +++ b/tests/ui/extern/extern-no-mangle.rs @@ -5,25 +5,22 @@ // The previous warning only talks about a "function or static" but foreign fns/statics // are also not allowed to have #[no_mangle] -//@ build-pass +//@ check-fail extern "C" { #[no_mangle] - //~^ WARNING attribute cannot be used on - //~| WARN previously accepted + //~^ ERROR attribute cannot be used on pub static FOO: u8; #[no_mangle] - //~^ WARNING attribute cannot be used on - //~| WARN previously accepted + //~^ ERROR attribute cannot be used on pub fn bar(); } fn no_new_warn() { // Should emit the generic "not a function or static" warning #[no_mangle] - //~^ WARNING attribute cannot be used on - //~| WARN previously accepted + //~^ ERROR attribute cannot be used on let x = 0_u8; } diff --git a/tests/ui/extern/extern-no-mangle.stderr b/tests/ui/extern/extern-no-mangle.stderr index 210beb1e70929..98b97bd89369c 100644 --- a/tests/ui/extern/extern-no-mangle.stderr +++ b/tests/ui/extern/extern-no-mangle.stderr @@ -1,34 +1,26 @@ -warning: the `no_mangle` attribute cannot be used on statements - --> $DIR/extern-no-mangle.rs:24:7 +error: the `no_mangle` attribute cannot be used on foreign statics + --> $DIR/extern-no-mangle.rs:11:7 | LL | #[no_mangle] | ^^^^^^^^^ | = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -note: the lint level is defined here - --> $DIR/extern-no-mangle.rs:1:9 - | -LL | #![warn(unused_attributes)] - | ^^^^^^^^^^^^^^^^^ -warning: the `no_mangle` attribute cannot be used on foreign statics - --> $DIR/extern-no-mangle.rs:11:7 +error: the `no_mangle` attribute cannot be used on foreign functions + --> $DIR/extern-no-mangle.rs:15:7 | LL | #[no_mangle] | ^^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: the `no_mangle` attribute can be applied to functions with a body and statics -warning: the `no_mangle` attribute cannot be used on foreign functions - --> $DIR/extern-no-mangle.rs:16:7 +error: the `no_mangle` attribute cannot be used on statements + --> $DIR/extern-no-mangle.rs:22:7 | LL | #[no_mangle] | ^^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions with a body and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: the `no_mangle` attribute can be applied to functions and statics -warning: 3 warnings emitted +error: aborting due to 3 previous errors diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs index 3cc404416839e..906b8718e9a55 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.rs @@ -25,8 +25,7 @@ //~^ WARN may not be used in combination with `#[export_name]` //~| NOTE is ignored //~| NOTE requested on the command line -//~| WARN cannot be used on crates -//~| WARN previously accepted +//~| ERROR cannot be used on crates #![no_link] //~^ ERROR: the `no_link` attribute cannot be used on crates #![export_name = "2200"] @@ -115,6 +114,7 @@ mod export_name { //~^ ERROR attribute cannot be used on #[export_name = "2200"] fn bar() {} + //~^ ERROR attribute cannot be used on } } @@ -155,4 +155,30 @@ mod repr_rust { //~^ ERROR: attribute cannot be used on } +#[no_mangle] +//~^ ERROR attribute cannot be used on +mod no_mangle { + mod inner { #![no_mangle] } + //~^ ERROR attribute cannot be used on + + #[no_mangle] fn f() { } + + #[no_mangle] struct S; + //~^ ERROR attribute cannot be used on + + #[no_mangle] type T = S; + //~^ ERROR attribute cannot be used on + + #[no_mangle] impl S { } + //~^ ERROR attribute cannot be used on + + trait Tr { + #[no_mangle] fn foo(); + //~^ ERROR attribute cannot be used on + + #[no_mangle] fn bar() {} + //~^ ERROR attribute cannot be used on + } +} + fn main() {} diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr index 44f7d6942a3a1..235704b901ce3 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs-error.stderr @@ -48,8 +48,16 @@ LL | #![automatically_derived] | = help: the `automatically_derived` attribute can only be applied to trait impl blocks +error: the `no_mangle` attribute cannot be used on crates + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:24:4 + | +LL | #![no_mangle] + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + error: the `no_link` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:30:4 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:29:4 | LL | #![no_link] | ^^^^^^^ @@ -57,7 +65,7 @@ LL | #![no_link] = help: the `no_link` attribute can only be applied to extern crates error: the `export_name` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:32:4 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:31:4 | LL | #![export_name = "2200"] | ^^^^^^^^^^^ @@ -65,7 +73,7 @@ LL | #![export_name = "2200"] = help: the `export_name` attribute can be applied to functions and statics error: the `inline` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:35:4 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:34:4 | LL | #![inline] | ^^^^^^ @@ -73,7 +81,7 @@ LL | #![inline] = help: the `inline` attribute can only be applied to functions error: the `inline` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:37:3 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:36:3 | LL | #[inline] | ^^^^^^ @@ -81,7 +89,7 @@ LL | #[inline] = help: the `inline` attribute can only be applied to functions error: the `inline` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:40:20 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:39:20 | LL | mod inner { #![inline] } | ^^^^^^ @@ -89,7 +97,7 @@ LL | mod inner { #![inline] } = help: the `inline` attribute can only be applied to functions error: the `inline` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:49:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:48:7 | LL | #[inline] struct S; | ^^^^^^ @@ -97,7 +105,7 @@ LL | #[inline] struct S; = help: the `inline` attribute can only be applied to functions error: the `inline` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:52:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:51:7 | LL | #[inline] type T = S; | ^^^^^^ @@ -105,7 +113,7 @@ LL | #[inline] type T = S; = help: the `inline` attribute can only be applied to functions error: the `inline` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:55:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:54:7 | LL | #[inline] impl S { } | ^^^^^^ @@ -113,7 +121,7 @@ LL | #[inline] impl S { } = help: the `inline` attribute can only be applied to functions error: the `no_link` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:59:3 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:58:3 | LL | #[no_link] | ^^^^^^^ @@ -121,7 +129,7 @@ LL | #[no_link] = help: the `no_link` attribute can only be applied to extern crates error: the `no_link` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:62:20 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:61:20 | LL | mod inner { #![no_link] } | ^^^^^^^ @@ -129,7 +137,7 @@ LL | mod inner { #![no_link] } = help: the `no_link` attribute can only be applied to extern crates error: the `no_link` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:65:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:64:7 | LL | #[no_link] fn f() { | ^^^^^^^ @@ -137,7 +145,7 @@ LL | #[no_link] fn f() { = help: the `no_link` attribute can only be applied to extern crates error: the `no_link` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:75:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:74:7 | LL | #[no_link] | ^^^^^^^ @@ -145,7 +153,7 @@ LL | #[no_link] = help: the `no_link` attribute can only be applied to extern crates error: the `no_link` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:84:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:83:7 | LL | #[no_link]type T = S; | ^^^^^^^ @@ -153,7 +161,7 @@ LL | #[no_link]type T = S; = help: the `no_link` attribute can only be applied to extern crates error: the `no_link` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:87:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:86:7 | LL | #[no_link] impl S { } | ^^^^^^^ @@ -161,7 +169,7 @@ LL | #[no_link] impl S { } = help: the `no_link` attribute can only be applied to extern crates error: the `export_name` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:96:3 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:95:3 | LL | #[export_name = "2200"] | ^^^^^^^^^^^ @@ -169,7 +177,7 @@ LL | #[export_name = "2200"] = help: the `export_name` attribute can be applied to functions and statics error: the `export_name` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:99:20 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:98:20 | LL | mod inner { #![export_name="2200"] } | ^^^^^^^^^^^ @@ -177,7 +185,7 @@ LL | mod inner { #![export_name="2200"] } = help: the `export_name` attribute can be applied to functions and statics error: the `export_name` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:104:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:103:7 | LL | #[export_name = "2200"] struct S; | ^^^^^^^^^^^ @@ -185,7 +193,7 @@ LL | #[export_name = "2200"] struct S; = help: the `export_name` attribute can be applied to functions and statics error: the `export_name` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:107:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:106:7 | LL | #[export_name = "2200"] type T = S; | ^^^^^^^^^^^ @@ -193,7 +201,7 @@ LL | #[export_name = "2200"] type T = S; = help: the `export_name` attribute can be applied to functions and statics error: the `export_name` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:110:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:109:7 | LL | #[export_name = "2200"] impl S { } | ^^^^^^^^^^^ @@ -201,13 +209,21 @@ LL | #[export_name = "2200"] impl S { } = help: the `export_name` attribute can be applied to functions and statics error: the `export_name` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:114:11 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:113:11 | LL | #[export_name = "2200"] fn foo(); | ^^^^^^^^^^^ | = help: the `export_name` attribute can be applied to functions with a body and statics +error: the `export_name` attribute cannot be used on provided trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:116:11 + | +LL | #[export_name = "2200"] fn bar() {} + | ^^^^^^^^^^^ + | + = help: the `export_name` attribute can be applied to functions, inherent methods, statics, and trait methods in impl blocks + error: the `repr(C)` attribute cannot be used on modules --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:121:3 | @@ -288,6 +304,62 @@ LL | #[repr(Rust)] impl S { } | = help: the `repr(Rust)` attribute can only be applied to data types +error: the `no_mangle` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:158:3 + | +LL | #[no_mangle] + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + +error: the `no_mangle` attribute cannot be used on modules + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:161:20 + | +LL | mod inner { #![no_mangle] } + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + +error: the `no_mangle` attribute cannot be used on structs + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:166:7 + | +LL | #[no_mangle] struct S; + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + +error: the `no_mangle` attribute cannot be used on type aliases + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:169:7 + | +LL | #[no_mangle] type T = S; + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + +error: the `no_mangle` attribute cannot be used on inherent impl blocks + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:172:7 + | +LL | #[no_mangle] impl S { } + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions and statics + +error: the `no_mangle` attribute cannot be used on required trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:176:11 + | +LL | #[no_mangle] fn foo(); + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions with a body and statics + +error: the `no_mangle` attribute cannot be used on provided trait methods + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:179:11 + | +LL | #[no_mangle] fn bar() {} + | ^^^^^^^^^ + | + = help: the `no_mangle` attribute can be applied to functions, inherent methods, statics, and trait methods in impl blocks + warning: `#[no_mangle]` attribute may not be used in combination with `#[export_name]` --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:24:1 | @@ -295,7 +367,7 @@ LL | #![no_mangle] | ^^^^^^^^^^^^^ `#[no_mangle]` is ignored | note: `#[export_name]` takes precedence - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:32:1 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:31:1 | LL | #![export_name = "2200"] | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -313,17 +385,8 @@ LL | #![repr()] | = note: using `repr` with an empty list has no effect -warning: the `no_mangle` attribute cannot be used on crates - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:24:4 - | -LL | #![no_mangle] - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - error: valid forms for the attribute are `inline`, `inline(always)`, and `inline(never)` - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:43:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:42:7 | LL | #[inline = "2100"] fn f() { } | ^^^^^^^^^^^^^^^ @@ -333,7 +396,7 @@ LL | #[inline = "2100"] fn f() { } = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default warning: the `no_link` attribute cannot be used on match arms - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:68:15 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:67:15 | LL | #[no_link] | ^^^^^^^ @@ -342,7 +405,7 @@ LL | #[no_link] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `no_link` attribute cannot be used on struct fields - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:78:11 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:77:11 | LL | #[no_link] | ^^^^^^^ @@ -351,7 +414,7 @@ LL | #[no_link] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `no_link` attribute cannot be used on macro defs - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:90:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:89:7 | LL | #[no_link] | ^^^^^^^ @@ -359,12 +422,12 @@ LL | #[no_link] = help: the `no_link` attribute can only be applied to extern crates = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: aborting due to 37 previous errors; 6 warnings emitted +error: aborting due to 46 previous errors; 5 warnings emitted For more information about this error, try `rustc --explain E0658`. Future incompatibility report: Future breakage diagnostic: error: valid forms for the attribute are `inline`, `inline(always)`, and `inline(never)` - --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:43:7 + --> $DIR/issue-43106-gating-of-builtin-attrs-error.rs:42:7 | LL | #[inline = "2100"] fn f() { } | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs index adbf64e8b0f63..91fc043de828f 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs @@ -330,53 +330,6 @@ mod automatically_derived { #[automatically_derived] impl W for S { } } -#[no_mangle] -//~^ WARN attribute cannot be used on -//~| WARN previously accepted -//~| HELP can be applied to -//~| HELP remove the attribute -mod no_mangle { - mod inner { #![no_mangle] } - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can be applied to - //~| HELP remove the attribute - - #[no_mangle] fn f() { } - - #[no_mangle] struct S; - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can be applied to - //~| HELP remove the attribute - - #[no_mangle] type T = S; - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can be applied to - //~| HELP remove the attribute - - #[no_mangle] impl S { } - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can be applied to - //~| HELP remove the attribute - - trait Tr { - #[no_mangle] fn foo(); - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can be applied to - //~| HELP remove the attribute - - #[no_mangle] fn bar() {} - //~^ WARN attribute cannot be used on -//~| WARN previously accepted - //~| HELP can be applied to - //~| HELP remove the attribute - } -} - #[should_panic] //~^ WARN attribute cannot be used on //~| WARN previously accepted diff --git a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr index 2d3b7658f9aae..2fe71462c7a02 100644 --- a/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr +++ b/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.stderr @@ -1,5 +1,5 @@ warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:479:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:17 | LL | mod inner { #![macro_escape] } | ^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | mod inner { #![macro_escape] } = help: try an outer attribute: `#[macro_use]` warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:1 | LL | #[macro_escape] | ^^^^^^^^^^^^^^^ @@ -477,53 +477,8 @@ LL | #[automatically_derived] impl S { } = help: the `automatically_derived` attribute can only be applied to trait impl blocks = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `no_mangle` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:3 - | -LL | #[no_mangle] - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: the `no_mangle` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:20 - | -LL | mod inner { #![no_mangle] } - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: the `no_mangle` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:7 - | -LL | #[no_mangle] struct S; - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: the `no_mangle` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:7 - | -LL | #[no_mangle] type T = S; - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: the `no_mangle` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:7 - | -LL | #[no_mangle] impl S { } - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - warning: the `should_panic` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:333:3 | LL | #[should_panic] | ^^^^^^^^^^^^ @@ -532,7 +487,7 @@ LL | #[should_panic] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `should_panic` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:339:20 | LL | mod inner { #![should_panic] } | ^^^^^^^^^^^^ @@ -541,7 +496,7 @@ LL | mod inner { #![should_panic] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `should_panic` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:7 | LL | #[should_panic] struct S; | ^^^^^^^^^^^^ @@ -550,7 +505,7 @@ LL | #[should_panic] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `should_panic` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:400:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:7 | LL | #[should_panic] type T = S; | ^^^^^^^^^^^^ @@ -559,7 +514,7 @@ LL | #[should_panic] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `should_panic` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:406:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:7 | LL | #[should_panic] impl S { } | ^^^^^^^^^^^^ @@ -568,7 +523,7 @@ LL | #[should_panic] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `ignore` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:3 | LL | #[ignore] | ^^^^^^ @@ -577,7 +532,7 @@ LL | #[ignore] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `ignore` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:419:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:20 | LL | mod inner { #![ignore] } | ^^^^^^ @@ -586,7 +541,7 @@ LL | mod inner { #![ignore] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `ignore` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:427:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:380:7 | LL | #[ignore] struct S; | ^^^^^^ @@ -595,7 +550,7 @@ LL | #[ignore] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `ignore` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:433:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:386:7 | LL | #[ignore] type T = S; | ^^^^^^ @@ -604,7 +559,7 @@ LL | #[ignore] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `ignore` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:439:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:392:7 | LL | #[ignore] impl S { } | ^^^^^^ @@ -613,7 +568,7 @@ LL | #[ignore] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `no_implicit_prelude` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:403:7 | LL | #[no_implicit_prelude] fn f() { } | ^^^^^^^^^^^^^^^^^^^ @@ -622,7 +577,7 @@ LL | #[no_implicit_prelude] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `no_implicit_prelude` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:456:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:7 | LL | #[no_implicit_prelude] struct S; | ^^^^^^^^^^^^^^^^^^^ @@ -631,7 +586,7 @@ LL | #[no_implicit_prelude] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `no_implicit_prelude` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:462:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:415:7 | LL | #[no_implicit_prelude] type T = S; | ^^^^^^^^^^^^^^^^^^^ @@ -640,7 +595,7 @@ LL | #[no_implicit_prelude] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `no_implicit_prelude` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:421:7 | LL | #[no_implicit_prelude] impl S { } | ^^^^^^^^^^^^^^^^^^^ @@ -649,7 +604,7 @@ LL | #[no_implicit_prelude] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `macro_escape` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:483:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:436:7 | LL | #[macro_escape] fn f() { } | ^^^^^^^^^^^^ @@ -658,7 +613,7 @@ LL | #[macro_escape] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `macro_escape` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:489:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:7 | LL | #[macro_escape] struct S; | ^^^^^^^^^^^^ @@ -667,7 +622,7 @@ LL | #[macro_escape] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `macro_escape` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:495:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:448:7 | LL | #[macro_escape] type T = S; | ^^^^^^^^^^^^ @@ -676,7 +631,7 @@ LL | #[macro_escape] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `macro_escape` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:501:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:454:7 | LL | #[macro_escape] impl S { } | ^^^^^^^^^^^^ @@ -685,13 +640,13 @@ LL | #[macro_escape] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:508:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:1 | LL | #[no_std] | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:510:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:463:1 | LL | / mod no_std { LL | | @@ -701,61 +656,61 @@ LL | | } | |_^ warning: the `#![no_std]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:17 | LL | mod inner { #![no_std] } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:5 | LL | #[no_std] fn f() { } | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:515:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:468:15 | LL | #[no_std] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:5 | LL | #[no_std] struct S; | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:519:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:472:15 | LL | #[no_std] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:5 | LL | #[no_std] type T = S; | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:476:15 | LL | #[no_std] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:5 | LL | #[no_std] impl S { } | ^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:527:15 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:480:15 | LL | #[no_std] impl S { } | ^^^^^^^^^^ warning: the `cold` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:549:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:502:3 | LL | #[cold] | ^^^^ @@ -764,7 +719,7 @@ LL | #[cold] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `cold` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:509:20 | LL | mod inner { #![cold] } | ^^^^ @@ -773,7 +728,7 @@ LL | mod inner { #![cold] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `cold` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:564:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:7 | LL | #[cold] struct S; | ^^^^ @@ -782,7 +737,7 @@ LL | #[cold] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `cold` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:570:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:523:7 | LL | #[cold] type T = S; | ^^^^ @@ -791,7 +746,7 @@ LL | #[cold] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `cold` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:576:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:529:7 | LL | #[cold] impl S { } | ^^^^ @@ -800,7 +755,7 @@ LL | #[cold] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:583:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:536:3 | LL | #[link_name = "1900"] | ^^^^^^^^^ @@ -809,7 +764,7 @@ LL | #[link_name = "1900"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on foreign modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:589:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:542:7 | LL | #[link_name = "1900"] | ^^^^^^^^^ @@ -818,7 +773,7 @@ LL | #[link_name = "1900"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:596:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:549:20 | LL | mod inner { #![link_name="1900"] } | ^^^^^^^^^ @@ -827,7 +782,7 @@ LL | mod inner { #![link_name="1900"] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:602:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:555:7 | LL | #[link_name = "1900"] fn f() { } | ^^^^^^^^^ @@ -836,7 +791,7 @@ LL | #[link_name = "1900"] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:608:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:561:7 | LL | #[link_name = "1900"] struct S; | ^^^^^^^^^ @@ -845,7 +800,7 @@ LL | #[link_name = "1900"] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:614:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:567:7 | LL | #[link_name = "1900"] type T = S; | ^^^^^^^^^ @@ -854,7 +809,7 @@ LL | #[link_name = "1900"] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_name` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:620:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:573:7 | LL | #[link_name = "1900"] impl S { } | ^^^^^^^^^ @@ -863,7 +818,7 @@ LL | #[link_name = "1900"] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_section` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:627:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:580:3 | LL | #[link_section = ",1800"] | ^^^^^^^^^^^^ @@ -872,7 +827,7 @@ LL | #[link_section = ",1800"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_section` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:633:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:586:20 | LL | mod inner { #![link_section=",1800"] } | ^^^^^^^^^^^^ @@ -881,7 +836,7 @@ LL | mod inner { #![link_section=",1800"] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_section` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:641:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:594:7 | LL | #[link_section = ",1800"] struct S; | ^^^^^^^^^^^^ @@ -890,7 +845,7 @@ LL | #[link_section = ",1800"] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_section` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:647:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:600:7 | LL | #[link_section = ",1800"] type T = S; | ^^^^^^^^^^^^ @@ -899,7 +854,7 @@ LL | #[link_section = ",1800"] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_section` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:653:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:606:7 | LL | #[link_section = ",1800"] impl S { } | ^^^^^^^^^^^^ @@ -908,7 +863,7 @@ LL | #[link_section = ",1800"] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link_section` attribute cannot be used on traits - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:659:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:612:7 | LL | #[link_section = ",1800"] | ^^^^^^^^^^^^ @@ -917,7 +872,7 @@ LL | #[link_section = ",1800"] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:646:3 | LL | #[link(name = "x")] | ^^^^ @@ -926,7 +881,7 @@ LL | #[link(name = "x")] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:652:20 | LL | mod inner { #![link(name = "x")] } | ^^^^ @@ -935,7 +890,7 @@ LL | mod inner { #![link(name = "x")] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link` attribute cannot be used on functions - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:705:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:7 | LL | #[link(name = "x")] fn f() { } | ^^^^ @@ -944,7 +899,7 @@ LL | #[link(name = "x")] fn f() { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link` attribute cannot be used on structs - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:664:7 | LL | #[link(name = "x")] struct S; | ^^^^ @@ -953,7 +908,7 @@ LL | #[link(name = "x")] struct S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:717:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:7 | LL | #[link(name = "x")] type T = S; | ^^^^ @@ -962,7 +917,7 @@ LL | #[link(name = "x")] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `link` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:723:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:676:7 | LL | #[link(name = "x")] impl S { } | ^^^^ @@ -971,7 +926,7 @@ LL | #[link(name = "x")] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: attribute should be applied to an `extern` block with non-Rust ABI - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:682:5 | LL | #[link(name = "x")] extern "Rust" {} | ^^^^^^^^^^^^^^^^^^^ @@ -979,7 +934,7 @@ LL | #[link(name = "x")] extern "Rust" {} = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:3 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:702:3 | LL | #[must_use] | ^^^^^^^^ @@ -988,7 +943,7 @@ LL | #[must_use] = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on modules - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:20 | LL | mod inner { #![must_use] } | ^^^^^^^^ @@ -997,7 +952,7 @@ LL | mod inner { #![must_use] } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on type aliases - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:763:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:7 | LL | #[must_use] type T = S; | ^^^^^^^^ @@ -1006,7 +961,7 @@ LL | #[must_use] type T = S; = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on inherent impl blocks - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:7 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:721:7 | LL | #[must_use] impl S { } | ^^^^^^^^ @@ -1015,13 +970,13 @@ LL | #[must_use] impl S { } = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:774:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:727:1 | LL | #[windows_subsystem = "windows"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:729:1 | LL | / mod windows_subsystem { LL | | @@ -1031,67 +986,67 @@ LL | | } | |_^ warning: the `#![windows_subsystem]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:731:17 | LL | mod inner { #![windows_subsystem="windows"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:5 | LL | #[windows_subsystem = "windows"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:38 | LL | #[windows_subsystem = "windows"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:5 | LL | #[windows_subsystem = "windows"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:785:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:38 | LL | #[windows_subsystem = "windows"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:5 | LL | #[windows_subsystem = "windows"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:789:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:38 | LL | #[windows_subsystem = "windows"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5 | LL | #[windows_subsystem = "windows"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:793:38 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:38 | LL | #[windows_subsystem = "windows"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:800:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:1 | LL | #[crate_name = "0900"] | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:802:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:755:1 | LL | / mod crate_name { LL | | @@ -1101,67 +1056,67 @@ LL | | } | |_^ warning: the `#![crate_name]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:804:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:17 | LL | mod inner { #![crate_name="0900"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:5 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:807:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:760:28 | LL | #[crate_name = "0900"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:5 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:811:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:764:28 | LL | #[crate_name = "0900"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:5 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:815:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:768:28 | LL | #[crate_name = "0900"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:819:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:5 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:819:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:28 | LL | #[crate_name = "0900"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:824:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:777:1 | LL | #[crate_type = "0800"] | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:779:1 | LL | / mod crate_type { LL | | @@ -1171,67 +1126,67 @@ LL | | } | |_^ warning: the `#![crate_type]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:781:17 | LL | mod inner { #![crate_type="0800"] } | ^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:831:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:28 | LL | #[crate_type = "0800"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:835:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:28 | LL | #[crate_type = "0800"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:839:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:28 | LL | #[crate_type = "0800"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:5 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:843:28 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:796:28 | LL | #[crate_type = "0800"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:848:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:1 | LL | #[feature(x0600)] | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:850:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:803:1 | LL | / mod feature { LL | | @@ -1241,67 +1196,67 @@ LL | | } | |_^ warning: the `#![feature]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:17 | LL | mod inner { #![feature(x0600)] } | ^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:855:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:5 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:855:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:808:23 | LL | #[feature(x0600)] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:859:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:5 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:859:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:812:23 | LL | #[feature(x0600)] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:863:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:5 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:863:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:816:23 | LL | #[feature(x0600)] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:5 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:867:23 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:820:23 | LL | #[feature(x0600)] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:873:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:826:1 | LL | #[no_main] | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:875:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:828:1 | LL | / mod no_main_1 { LL | | @@ -1311,67 +1266,67 @@ LL | | } | |_^ warning: the `#![no_main]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:877:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:830:17 | LL | mod inner { #![no_main] } | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:5 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:880:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:833:16 | LL | #[no_main] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:837:5 | LL | #[no_main] struct S; | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:884:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:837:16 | LL | #[no_main] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:888:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:841:5 | LL | #[no_main] type T = S; | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:888:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:841:16 | LL | #[no_main] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:892:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:845:5 | LL | #[no_main] impl S { } | ^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:892:16 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:845:16 | LL | #[no_main] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:897:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:850:1 | LL | #[no_builtins] | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:899:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:852:1 | LL | / mod no_builtins { LL | | @@ -1381,67 +1336,67 @@ LL | | } | |_^ warning: the `#![no_builtins]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:901:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:854:17 | LL | mod inner { #![no_builtins] } | ^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:857:5 | LL | #[no_builtins] fn f() { } | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:904:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:857:20 | LL | #[no_builtins] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:861:5 | LL | #[no_builtins] struct S; | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:908:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:861:20 | LL | #[no_builtins] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:912:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:865:5 | LL | #[no_builtins] type T = S; | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:912:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:865:20 | LL | #[no_builtins] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:916:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:869:5 | LL | #[no_builtins] impl S { } | ^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:916:20 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:869:20 | LL | #[no_builtins] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:921:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:874:1 | LL | #[recursion_limit="0200"] | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:923:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:876:1 | LL | / mod recursion_limit { LL | | @@ -1451,67 +1406,67 @@ LL | | } | |_^ warning: the `#![recursion_limit]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:925:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:878:17 | LL | mod inner { #![recursion_limit="0200"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:928:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:881:5 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:928:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:881:31 | LL | #[recursion_limit="0200"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:932:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:885:5 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:932:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:885:31 | LL | #[recursion_limit="0200"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:936:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:889:5 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:936:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:889:31 | LL | #[recursion_limit="0200"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:940:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:893:5 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:940:31 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:893:31 | LL | #[recursion_limit="0200"] impl S { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:945:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:898:1 | LL | #[type_length_limit="0100"] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this module - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:947:1 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:900:1 | LL | / mod type_length_limit { LL | | @@ -1521,79 +1476,61 @@ LL | | } | |_^ warning: the `#![type_length_limit]` attribute can only be used at the crate root - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:949:17 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:902:17 | LL | mod inner { #![type_length_limit="0100"] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:952:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:905:5 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this function - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:952:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:905:33 | LL | #[type_length_limit="0100"] fn f() { } | ^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:956:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:909:5 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this struct - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:956:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:909:33 | LL | #[type_length_limit="0100"] struct S; | ^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:960:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:913:5 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this type alias - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:960:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:913:33 | LL | #[type_length_limit="0100"] type T = S; | ^^^^^^^^^^^ warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]` - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:964:5 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:917:5 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: this attribute does not have an `!`, which means it is applied to this implementation block - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:964:33 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:917:33 | LL | #[type_length_limit="0100"] impl S { } | ^^^^^^^^^^ -warning: the `no_mangle` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:11 - | -LL | #[no_mangle] fn foo(); - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions with a body and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - -warning: the `no_mangle` attribute cannot be used on provided trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:11 - | -LL | #[no_mangle] fn bar() {} - | ^^^^^^^^^ - | - = help: the `no_mangle` attribute can be applied to functions, inherent methods, statics, and trait methods in impl blocks - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - warning: the `link_section` attribute cannot be used on required trait methods - --> $DIR/issue-43106-gating-of-builtin-attrs.rs:665:11 + --> $DIR/issue-43106-gating-of-builtin-attrs.rs:618:11 | LL | #[link_section = ",1800"] | ^^^^^^^^^^^^ @@ -1601,5 +1538,5 @@ LL | #[link_section = ",1800"] = help: the `link_section` attribute can be applied to functions with a body and statics = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: 171 warnings emitted +warning: 164 warnings emitted diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs index 7f1d5c849ebe6..347d7562c23cd 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs +++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs @@ -14,8 +14,7 @@ extern "C" { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN cannot be used on function params - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ); } @@ -34,8 +33,7 @@ type FnType = fn( //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN cannot be used on function params - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ); pub fn foo( @@ -53,8 +51,7 @@ pub fn foo( //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} struct SelfStruct {} @@ -77,8 +74,7 @@ impl SelfStruct { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} fn issue_64682_associated_fn( @@ -96,8 +92,7 @@ impl SelfStruct { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} } @@ -121,8 +116,7 @@ impl RefStruct { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} } trait RefTrait { @@ -144,8 +138,7 @@ trait RefTrait { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} fn issue_64682_associated_fn( @@ -163,8 +156,7 @@ trait RefTrait { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} } @@ -187,8 +179,7 @@ impl RefTrait for RefStruct { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32, //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on ) {} } @@ -208,7 +199,6 @@ fn main() { //~^ ERROR documentation comments cannot be applied to function #[no_mangle] b: i32 //~^ ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - //~| WARN attribute cannot be used on - //~| WARN previously accepted + //~| ERROR attribute cannot be used on | {}; } diff --git a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr index db2d8f161dba0..baa6a3ee6666e 100644 --- a/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr +++ b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr @@ -5,55 +5,55 @@ LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:25:7 + --> $DIR/param-attrs-builtin-attrs.rs:24:7 | LL | #[test] a: u32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:44:7 + --> $DIR/param-attrs-builtin-attrs.rs:42:7 | LL | #[test] a: u32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:68:11 + --> $DIR/param-attrs-builtin-attrs.rs:65:11 | LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:87:11 + --> $DIR/param-attrs-builtin-attrs.rs:83:11 | LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:112:11 + --> $DIR/param-attrs-builtin-attrs.rs:107:11 | LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:135:11 + --> $DIR/param-attrs-builtin-attrs.rs:129:11 | LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:154:11 + --> $DIR/param-attrs-builtin-attrs.rs:147:11 | LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:178:11 + --> $DIR/param-attrs-builtin-attrs.rs:170:11 | LL | #[test] a: i32, | ^^^^ not a non-macro attribute error: expected non-macro attribute, found attribute macro `test` - --> $DIR/param-attrs-builtin-attrs.rs:199:11 + --> $DIR/param-attrs-builtin-attrs.rs:190:11 | LL | #[test] a: u32, | ^^^^ not a non-macro attribute @@ -89,410 +89,400 @@ LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:23:5 + --> $DIR/param-attrs-builtin-attrs.rs:22:5 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:27:5 + --> $DIR/param-attrs-builtin-attrs.rs:26:5 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:29:5 + --> $DIR/param-attrs-builtin-attrs.rs:28:5 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:33:5 + --> $DIR/param-attrs-builtin-attrs.rs:32:5 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:35:5 + --> $DIR/param-attrs-builtin-attrs.rs:34:5 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:42:5 + --> $DIR/param-attrs-builtin-attrs.rs:40:5 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:46:5 + --> $DIR/param-attrs-builtin-attrs.rs:44:5 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:48:5 + --> $DIR/param-attrs-builtin-attrs.rs:46:5 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:52:5 + --> $DIR/param-attrs-builtin-attrs.rs:50:5 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:54:5 + --> $DIR/param-attrs-builtin-attrs.rs:52:5 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:63:9 + --> $DIR/param-attrs-builtin-attrs.rs:60:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:66:9 + --> $DIR/param-attrs-builtin-attrs.rs:63:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:70:9 + --> $DIR/param-attrs-builtin-attrs.rs:67:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:72:9 + --> $DIR/param-attrs-builtin-attrs.rs:69:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:76:9 + --> $DIR/param-attrs-builtin-attrs.rs:73:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:78:9 + --> $DIR/param-attrs-builtin-attrs.rs:75:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:85:9 + --> $DIR/param-attrs-builtin-attrs.rs:81:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:89:9 + --> $DIR/param-attrs-builtin-attrs.rs:85:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:91:9 + --> $DIR/param-attrs-builtin-attrs.rs:87:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:95:9 + --> $DIR/param-attrs-builtin-attrs.rs:91:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:97:9 + --> $DIR/param-attrs-builtin-attrs.rs:93:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:107:9 + --> $DIR/param-attrs-builtin-attrs.rs:102:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:110:9 + --> $DIR/param-attrs-builtin-attrs.rs:105:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:114:9 + --> $DIR/param-attrs-builtin-attrs.rs:109:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:116:9 + --> $DIR/param-attrs-builtin-attrs.rs:111:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:120:9 + --> $DIR/param-attrs-builtin-attrs.rs:115:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:122:9 + --> $DIR/param-attrs-builtin-attrs.rs:117:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:130:9 + --> $DIR/param-attrs-builtin-attrs.rs:124:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:133:9 + --> $DIR/param-attrs-builtin-attrs.rs:127:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:137:9 + --> $DIR/param-attrs-builtin-attrs.rs:131:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:139:9 + --> $DIR/param-attrs-builtin-attrs.rs:133:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:143:9 + --> $DIR/param-attrs-builtin-attrs.rs:137:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:145:9 + --> $DIR/param-attrs-builtin-attrs.rs:139:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:152:9 + --> $DIR/param-attrs-builtin-attrs.rs:145:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:156:9 + --> $DIR/param-attrs-builtin-attrs.rs:149:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:158:9 + --> $DIR/param-attrs-builtin-attrs.rs:151:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:162:9 + --> $DIR/param-attrs-builtin-attrs.rs:155:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:164:9 + --> $DIR/param-attrs-builtin-attrs.rs:157:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:173:9 + --> $DIR/param-attrs-builtin-attrs.rs:165:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:176:9 + --> $DIR/param-attrs-builtin-attrs.rs:168:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:180:9 + --> $DIR/param-attrs-builtin-attrs.rs:172:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:182:9 + --> $DIR/param-attrs-builtin-attrs.rs:174:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:186:9 + --> $DIR/param-attrs-builtin-attrs.rs:178:9 | LL | /// Qux | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:188:9 + --> $DIR/param-attrs-builtin-attrs.rs:180:9 | LL | #[no_mangle] b: i32, | ^^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:197:9 + --> $DIR/param-attrs-builtin-attrs.rs:188:9 | LL | /// Foo | ^^^^^^^ doc comments are not allowed here error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:201:9 + --> $DIR/param-attrs-builtin-attrs.rs:192:9 | LL | /// Bar | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:203:9 + --> $DIR/param-attrs-builtin-attrs.rs:194:9 | LL | #[must_use] | ^^^^^^^^^^^ error: documentation comments cannot be applied to function parameters - --> $DIR/param-attrs-builtin-attrs.rs:207:9 + --> $DIR/param-attrs-builtin-attrs.rs:198:9 | LL | /// Baz | ^^^^^^^ doc comments are not allowed here error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/param-attrs-builtin-attrs.rs:209:9 + --> $DIR/param-attrs-builtin-attrs.rs:200:9 | LL | #[no_mangle] b: i32 | ^^^^^^^^^^^^ -warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:29:7 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:15:11 | -LL | #[must_use] - | ^^^^^^^^ +LL | #[no_mangle] b: i32, + | ^^^^^^^^^ | - = help: the `must_use` attribute can be applied to data types, functions, and traits - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! - = note: requested on the command line with `-W unused-attributes` + = help: the `no_mangle` attribute can be applied to functions and statics -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:35:7 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:34:7 | LL | #[no_mangle] b: i32, | ^^^^^^^^^ | = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:48:7 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:52:7 | -LL | #[must_use] - | ^^^^^^^^ +LL | #[no_mangle] b: i32, + | ^^^^^^^^^ | - = help: the `must_use` attribute can be applied to data types, functions, and traits - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: the `no_mangle` attribute can be applied to functions and statics -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:54:7 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:75:11 | -LL | #[no_mangle] b: i32, - | ^^^^^^^^^ +LL | #[no_mangle] b: i32, + | ^^^^^^^^^ | = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:203:11 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:93:11 | -LL | #[must_use] - | ^^^^^^^^ +LL | #[no_mangle] b: i32, + | ^^^^^^^^^ | - = help: the `must_use` attribute can be applied to data types, functions, and traits - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: the `no_mangle` attribute can be applied to functions and statics -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:209:11 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:117:11 | -LL | #[no_mangle] b: i32 +LL | #[no_mangle] b: i32, | ^^^^^^^^^ | = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `must_use` attribute cannot be used on function params +error: the `no_mangle` attribute cannot be used on function params --> $DIR/param-attrs-builtin-attrs.rs:139:11 | -LL | #[must_use] - | ^^^^^^^^ +LL | #[no_mangle] b: i32, + | ^^^^^^^^^ | - = help: the `must_use` attribute can be applied to data types, functions, and traits - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: the `no_mangle` attribute can be applied to functions and statics -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:145:11 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:157:11 | LL | #[no_mangle] b: i32, | ^^^^^^^^^ | = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:158:11 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:180:11 | -LL | #[must_use] - | ^^^^^^^^ +LL | #[no_mangle] b: i32, + | ^^^^^^^^^ | - = help: the `must_use` attribute can be applied to data types, functions, and traits - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = help: the `no_mangle` attribute can be applied to functions and statics -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:164:11 +error: the `no_mangle` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:200:11 | -LL | #[no_mangle] b: i32, +LL | #[no_mangle] b: i32 | ^^^^^^^^^ | = help: the `no_mangle` attribute can be applied to functions and statics - = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:72:11 + --> $DIR/param-attrs-builtin-attrs.rs:28:7 | -LL | #[must_use] - | ^^^^^^^^ +LL | #[must_use] + | ^^^^^^^^ | = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: requested on the command line with `-W unused-attributes` -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:78:11 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:46:7 | -LL | #[no_mangle] b: i32, - | ^^^^^^^^^ +LL | #[must_use] + | ^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions and statics + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:91:11 + --> $DIR/param-attrs-builtin-attrs.rs:194:11 | LL | #[must_use] | ^^^^^^^^ @@ -500,17 +490,17 @@ LL | #[must_use] = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:97:11 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:133:11 | -LL | #[no_mangle] b: i32, - | ^^^^^^^^^ +LL | #[must_use] + | ^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions and statics + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:116:11 + --> $DIR/param-attrs-builtin-attrs.rs:151:11 | LL | #[must_use] | ^^^^^^^^ @@ -518,17 +508,17 @@ LL | #[must_use] = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:122:11 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:69:11 | -LL | #[no_mangle] b: i32, - | ^^^^^^^^^ +LL | #[must_use] + | ^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions and statics + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:182:11 + --> $DIR/param-attrs-builtin-attrs.rs:87:11 | LL | #[must_use] | ^^^^^^^^ @@ -536,17 +526,17 @@ LL | #[must_use] = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:188:11 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:111:11 | -LL | #[no_mangle] b: i32, - | ^^^^^^^^^ +LL | #[must_use] + | ^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions and statics + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! warning: the `must_use` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:9:11 + --> $DIR/param-attrs-builtin-attrs.rs:174:11 | LL | #[must_use] | ^^^^^^^^ @@ -554,14 +544,14 @@ LL | #[must_use] = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -warning: the `no_mangle` attribute cannot be used on function params - --> $DIR/param-attrs-builtin-attrs.rs:15:11 +warning: the `must_use` attribute cannot be used on function params + --> $DIR/param-attrs-builtin-attrs.rs:9:11 | -LL | #[no_mangle] b: i32, - | ^^^^^^^^^ +LL | #[must_use] + | ^^^^^^^^ | - = help: the `no_mangle` attribute can be applied to functions and statics + = help: the `must_use` attribute can be applied to data types, functions, and traits = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! -error: aborting due to 64 previous errors; 20 warnings emitted +error: aborting due to 74 previous errors; 10 warnings emitted From 939c86c06a20886a0f3854b4ffc772805e484a8c Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Fri, 23 Oct 2026 15:11:25 +0200 Subject: [PATCH 2/2] Remove now irrelevant miri test --- src/tools/miri/test-cargo-miri/Cargo.lock | 5 ----- src/tools/miri/test-cargo-miri/Cargo.toml | 1 - .../issue-rust-86261/Cargo.toml | 7 ------- .../issue-rust-86261/src/lib.rs | 19 ------------------- src/tools/miri/test-cargo-miri/src/main.rs | 5 ----- 5 files changed, 37 deletions(-) delete mode 100644 src/tools/miri/test-cargo-miri/issue-rust-86261/Cargo.toml delete mode 100644 src/tools/miri/test-cargo-miri/issue-rust-86261/src/lib.rs diff --git a/src/tools/miri/test-cargo-miri/Cargo.lock b/src/tools/miri/test-cargo-miri/Cargo.lock index dd81c3b03bd39..7f79820a66367 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.lock +++ b/src/tools/miri/test-cargo-miri/Cargo.lock @@ -32,7 +32,6 @@ dependencies = [ "issue_1567", "issue_1691", "issue_1705", - "issue_rust_86261", "proc-macro2", "proc_macro_crate", ] @@ -82,10 +81,6 @@ dependencies = [ "byteorder 1.5.0", ] -[[package]] -name = "issue_rust_86261" -version = "0.1.0" - [[package]] name = "once_cell" version = "1.21.3" diff --git a/src/tools/miri/test-cargo-miri/Cargo.toml b/src/tools/miri/test-cargo-miri/Cargo.toml index 45168dff155d3..e2775fcd41218 100644 --- a/src/tools/miri/test-cargo-miri/Cargo.toml +++ b/src/tools/miri/test-cargo-miri/Cargo.toml @@ -14,7 +14,6 @@ proc_macro_crate = { path = "proc-macro-crate" } issue_1567 = { path = "issue-1567" } issue_1691 = { path = "issue-1691" } issue_1705 = { path = "issue-1705" } -issue_rust_86261 = { path = "issue-rust-86261" } [dev-dependencies] byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming diff --git a/src/tools/miri/test-cargo-miri/issue-rust-86261/Cargo.toml b/src/tools/miri/test-cargo-miri/issue-rust-86261/Cargo.toml deleted file mode 100644 index 5a664e407bd53..0000000000000 --- a/src/tools/miri/test-cargo-miri/issue-rust-86261/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "issue_rust_86261" -version = "0.1.0" -edition = "2018" - -[lib] -test = false diff --git a/src/tools/miri/test-cargo-miri/issue-rust-86261/src/lib.rs b/src/tools/miri/test-cargo-miri/issue-rust-86261/src/lib.rs deleted file mode 100644 index ab0fa8f013968..0000000000000 --- a/src/tools/miri/test-cargo-miri/issue-rust-86261/src/lib.rs +++ /dev/null @@ -1,19 +0,0 @@ -#![allow(unused_imports, unused_attributes)] - -// Regression test for https://github.com/rust-lang/rust/issues/86261: -// `#[no_mangle]` on a `use` item. -#[no_mangle] -use std::{any, boxed, io, panic, string, thread}; - -// `#[no_mangle]` on a struct has a similar problem. -#[no_mangle] -pub struct NoMangleStruct; - -// If `#[no_mangle]` has effect on the `struct` above, calling `NoMangleStruct` will fail with -// "multiple definitions of symbol `NoMangleStruct`" error. -#[export_name = "NoMangleStruct"] -fn no_mangle_struct() {} - -// Same as `no_mangle_struct()` but for the `no_mangle_struct()` function. -#[export_name = "no_mangle_struct"] -fn no_mangle_alias() {} diff --git a/src/tools/miri/test-cargo-miri/src/main.rs b/src/tools/miri/test-cargo-miri/src/main.rs index ed16a14e3d60f..5456ad7eb39d1 100644 --- a/src/tools/miri/test-cargo-miri/src/main.rs +++ b/src/tools/miri/test-cargo-miri/src/main.rs @@ -69,7 +69,6 @@ mod test { extern crate cargo_miri_test; extern crate exported_symbol; - extern crate issue_rust_86261; // Make sure in-crate tests with dev-dependencies work #[test] @@ -86,14 +85,10 @@ mod test { fn exported_symbol() -> i32; fn assoc_fn_as_exported_symbol() -> i32; fn make_true() -> bool; - fn NoMangleStruct(); - fn no_mangle_struct(); } assert_eq!(unsafe { exported_symbol() }, 123456); assert_eq!(unsafe { assoc_fn_as_exported_symbol() }, -123456); assert!(unsafe { make_true() }); - unsafe { NoMangleStruct() } - unsafe { no_mangle_struct() } } }