Skip to content

Rollup of 2 pull requests#155090

Closed
JonathanBrouwer wants to merge 6 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-6iOfyuw
Closed

Rollup of 2 pull requests#155090
JonathanBrouwer wants to merge 6 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-6iOfyuw

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

GokhanKabar and others added 6 commits March 13, 2026 00:16
Builtin attribute macros like #[eii] generate AST items
programmatically without collected tokens. When another attribute macro
was present on the same item, the compiler would panic in
TokenStream::from_ast() trying to tokenize the generated items during
subsequent attribute expansion.

Generate fake token streams (via pretty-print and re-parse) for Item
and ForeignItem nodes that lack collected tokens, following the
existing pattern used for Crate and out-of-line modules.
…ass test

When a function has `eii_impls` set (via `eii_shared_macro`), the `#[hello]`
attribute is consumed from `node.attrs()`. A subsequent `AttrProcMacro` expander
like `contracts::requires` calls `item.to_tokens()` which uses the current
`node.attrs()` — so `#[hello]` is missing from the token stream. After the
roundtrip and `parse_ast_fragment`, the new AST item has empty `eii_impls`
and the EII link is broken.

Fix this by using `fake_token_stream_for_item` when the item is a function
with non-empty `eii_impls`. The pretty-printer re-emits `eii_impls` as
`#[hello]` in `print_fn_full`, which survives the roundtrip and gets
re-expanded by `eii_shared_macro` on the resulting item.

Add a run-pass test to verify EII + contract annotation works correctly
at runtime.
…erated_item test

The previous test used `fn implementation() {}` with a body, which caused
`generate_default_impl` to generate a `const _: () = { fn implementation() {} }`
item containing `self::implementation`. On Linux (aarch64-gnu-llvm-21), the
resolver's `suggest_ident_hidden_by_hygiene` emitted an extra help span on the
resulting E0425 error that did not appear on macOS, causing a stderr mismatch.

Switch the declaration to `fn implementation();` (no body) so that
`generate_default_impl` is not called and no `self::implementation` path is
emitted. The test still validates that `#[eii]` + `#[core::contracts::ensures]`
produces graceful errors instead of an ICE, via the two contract-annotation
errors on the generated foreign item.
…-eii-attr-expansion, r=jdonszelmann

Fix ICE when combining #[eii] with #[core::contracts::ensures]

Fixes rust-lang#153745

Builtin attribute macros like #[eii] generate AST items programmatically without collected tokens. When another attribute macro was present on the same item, the compiler would panic in TokenStream::from_ast() trying to tokenize the generated items during subsequent attribute expansion.

Generate fake token streams (via pretty-print and re-parse) for Item and ForeignItem nodes that lack collected tokens, following the existing pattern used for Crate and out-of-line modules.
…, r=JonathanBrouwer

error on invalid macho section specifier

The macho section specifier used by `#[link_section = "..."]` is more strict than e.g. the one for elf. LLVM will error when you get it wrong, which is easy to do if you're used to elf. So, provide some guidance for the simplest mistakes, based on the LLVM validation.

Currently compilation fails with an LLVM error, see https://godbolt.org/z/WoE8EdK1K.

The LLVM validation logic is at

https://github.com/llvm/llvm-project/blob/a0f0d6342e0cd75b7f41e0e6aae0944393b68a62/llvm/lib/MC/MCSectionMachO.cpp#L199-L203

LLVM validates the other components of the section specifier too, but it feels a bit fragile to duplicate those checks. If you get that far, hopefully the LLVM errors will be sufficient to get unstuck.

---

sidequest from rust-lang#147811

r? JonathanBrouwer

specifically, is this the right place for this sort of validation? `rustc_attr_parsing` also does some validation.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Apr 10, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 10, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

📌 Commit 537085f has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 10, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Apr 10, 2026
…uwer

Rollup of 2 pull requests

Successful merges:

 - #153796 (Fix ICE when combining #[eii] with #[core::contracts::ensures])
 - #155065 (error on invalid macho section specifier)
@rust-log-analyzer
Copy link
Copy Markdown
Collaborator

The job aarch64-apple failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
+    |
+ LL | #[link_section = ".custom_section"]
+    |                  ^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
73 error[E0787]: the `asm!` macro is not allowed in naked functions
74   --> $DIR/naked-functions.rs:13:14
75    |

---
+    |
+ LL | #[link_section = ".custom_section"]
+    |                  ^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: aborting due to 26 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args asm/naked-functions.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/asm/naked-functions" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: the `in` operand cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:47:29
   |
LL |     naked_asm!("/* {0} */", in(reg) a)
   |                             ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it

error: the `in` operand cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:68:10
   |
LL |          in(reg) a,
   |          ^^ the `in` operand is not meaningful for global-scoped inline assembly, remove it

error: the `noreturn` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:88:28
   |
LL |     naked_asm!("", options(noreturn));
   |                            ^^^^^^^^ the `noreturn` option is not meaningful for global-scoped inline assembly

error: the `nomem` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:105:28
   |
LL |     naked_asm!("", options(nomem, preserves_flags));
   |                            ^^^^^ the `nomem` option is not meaningful for global-scoped inline assembly

error: the `preserves_flags` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:105:35
   |
LL |     naked_asm!("", options(nomem, preserves_flags));
   |                                   ^^^^^^^^^^^^^^^ the `preserves_flags` option is not meaningful for global-scoped inline assembly

error: the `readonly` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:112:28
   |
LL |     naked_asm!("", options(readonly, nostack), options(pure));
   |                            ^^^^^^^^ the `readonly` option is not meaningful for global-scoped inline assembly

error: the `nostack` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:112:38
   |
LL |     naked_asm!("", options(readonly, nostack), options(pure));
   |                                      ^^^^^^^ the `nostack` option is not meaningful for global-scoped inline assembly

error: the `pure` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:112:56
   |
LL |     naked_asm!("", options(readonly, nostack), options(pure));
   |                                                        ^^^^ the `pure` option is not meaningful for global-scoped inline assembly

error: the `may_unwind` option cannot be used with `naked_asm!`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:120:28
   |
LL |     naked_asm!("", options(may_unwind));
---
   |
LL | #[link_section = ".custom_section"]
   |                  ^^^^^^^^^^^^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error[E0787]: the `asm!` macro is not allowed in naked functions
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:13:14
   |
LL |     unsafe { asm!("", options(raw)) };
   |              ^^^^^^^^^^^^^^^^^^^^^^ consider using the `naked_asm!` macro instead

error: patterns not allowed in naked function parameters
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:25:5
   |
LL |     mut a: u32,
   |     ^^^^^

error: patterns not allowed in naked function parameters
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:27:5
   |
LL |     &b: &i32,
   |     ^^

error: patterns not allowed in naked function parameters
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:29:6
   |
LL |     (None | Some(_)): Option<std::ptr::NonNull<u8>>,
   |      ^^^^^^^^^^^^^^

error: patterns not allowed in naked function parameters
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:31:5
   |
LL |     P { x, y }: P,
   |     ^^^^^^^^^^

error: referencing function parameters is not allowed in naked functions
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:40:5
   |
---
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:52:1
   |
LL | pub extern "C" fn inc_closure(a: u32) -> u32 {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL |     //~^ ERROR naked functions must contain a single `naked_asm!` invocation
LL |     (|| a + 1)()
   |     ------------ not allowed in naked functions

error[E0787]: naked functions must contain a single `naked_asm!` invocation
##[error]  --> /Users/runner/work/rust/rust/tests/ui/asm/naked-functions.rs:58:1
   |
LL | pub extern "C" fn unsupported_operands() {
---
---- [ui] tests/ui/attributes/attr-on-mac-call.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/attributes/attr-on-mac-call.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/attributes/attr-on-mac-call" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/attributes/attr-on-mac-call.rs:30:22
   |
LL |     #[link_section = "x"]
   |                      ^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

warning: `#[export_name]` attribute cannot be used on macro calls
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/attributes/attr-on-mac-call.rs:6:5
   |
LL |     #[export_name = "x"]
---

warning: `#[target_feature]` attribute cannot be used on macro calls
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/attributes/attr-on-mac-call.rs:18:5
   |
LL |     #[target_feature(enable = "x")]
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[target_feature]` 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!
   = help: `#[non_exhaustive]` can be applied to data types and enum variants

warning: `#[proc_macro]` attribute cannot be used on macro calls
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/attributes/attr-on-mac-call.rs:39:5
   |
LL |     #[proc_macro]
   |     ^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[proc_macro]` can only be applied to functions

warning: `#[cold]` attribute cannot be used on macro calls
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/attributes/attr-on-mac-call.rs:42:5
   |
LL |     #[cold]
---
+    |
+ LL |     #[link_section = ".text"]
+    |                      ^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
1 error: `#[cold]` attribute cannot be used on required trait methods
2   --> $DIR/codegen_attr_on_required_trait_method.rs:6:5
3    |

---
+    |
+ LL |     #[link_section = ".text"]
+    |                      ^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: aborting due to 4 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args attributes/codegen_attr_on_required_trait_method.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/attributes/codegen_attr_on_required_trait_method.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/attributes/codegen_attr_on_required_trait_method" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/attributes/codegen_attr_on_required_trait_method.rs:10:22
   |
LL |     #[link_section = ".text"]
   |                      ^^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: `#[cold]` attribute cannot be used on required trait methods
##[error]  --> /Users/runner/work/rust/rust/tests/ui/attributes/codegen_attr_on_required_trait_method.rs:6:5
   |
LL |     #[cold]
---
---- [ui] tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/feature-gates/issue-43106-gating-of-builtin-attrs" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:471:17
   |
LL |     mod inner { #![macro_escape] }
   |                 ^^^^^^^^^^^^^^^^
   |
   = help: try an outer attribute: `#[macro_use]`

warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
---

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:42:9
   |
LL | #![warn(x5400)] //~ WARN unknown lint: `x5400`
   |         ^^^^^
   |
note: the lint level is defined here
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:36:28
   |
LL | #![warn(unused_attributes, unknown_lints)]
   |                            ^^^^^^^^^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:43:10
   |
LL | #![allow(x5300)] //~ WARN unknown lint: `x5300`
   |          ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:44:11
   |
LL | #![forbid(x5200)] //~ WARN unknown lint: `x5200`
   |           ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:45:9
   |
LL | #![deny(x5100)] //~ WARN unknown lint: `x5100`
   |         ^^^^^

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:109:8
   |
LL | #[warn(x5400)]
   |        ^^^^^

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:112:25
   |
LL |     mod inner { #![warn(x5400)] }
   |                         ^^^^^

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:115:12
   |
LL |     #[warn(x5400)] fn f() { }
   |            ^^^^^

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:118:12
   |
LL |     #[warn(x5400)] struct S;
   |            ^^^^^

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:121:12
   |
LL |     #[warn(x5400)] type T = S;
   |            ^^^^^

warning: unknown lint: `x5400`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:124:12
   |
LL |     #[warn(x5400)] impl S { }
   |            ^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:128:9
   |
LL | #[allow(x5300)]
   |         ^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:131:26
   |
LL |     mod inner { #![allow(x5300)] }
   |                          ^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:134:13
   |
LL |     #[allow(x5300)] fn f() { }
   |             ^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:137:13
   |
LL |     #[allow(x5300)] struct S;
   |             ^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:140:13
   |
LL |     #[allow(x5300)] type T = S;
   |             ^^^^^

warning: unknown lint: `x5300`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:143:13
   |
LL |     #[allow(x5300)] impl S { }
   |             ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:147:10
   |
LL | #[forbid(x5200)]
   |          ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:150:27
   |
LL |     mod inner { #![forbid(x5200)] }
   |                           ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:153:14
   |
LL |     #[forbid(x5200)] fn f() { }
   |              ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:156:14
   |
LL |     #[forbid(x5200)] struct S;
   |              ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:159:14
   |
LL |     #[forbid(x5200)] type T = S;
   |              ^^^^^

warning: unknown lint: `x5200`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:162:14
   |
LL |     #[forbid(x5200)] impl S { }
   |              ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:166:8
   |
LL | #[deny(x5100)]
   |        ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:169:25
   |
LL |     mod inner { #![deny(x5100)] }
   |                         ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:172:12
   |
LL |     #[deny(x5100)] fn f() { }
   |            ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:175:12
   |
LL |     #[deny(x5100)] struct S;
   |            ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:178:12
   |
LL |     #[deny(x5100)] type T = S;
   |            ^^^^^

warning: unknown lint: `x5100`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:181:12
   |
LL |     #[deny(x5100)] impl S { }
   |            ^^^^^

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:77:19
   |
LL | #![link_section = "1800"]
   |                   ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:619:18
   |
LL | #[link_section = "1800"]
   |                  ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:625:33
   |
LL |     mod inner { #![link_section="1800"] }
   |                                 ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:631:22
   |
LL |     #[link_section = "1800"] fn f() { }
   |                      ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:633:22
   |
LL |     #[link_section = "1800"] struct S;
   |                      ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:639:22
   |
LL |     #[link_section = "1800"] type T = S;
   |                      ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:645:22
   |
LL |     #[link_section = "1800"] impl S { }
   |                      ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:651:22
   |
LL |     #[link_section = "1800"]
   |                      ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:657:26
   |
LL |         #[link_section = "1800"]
   |                          ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:664:26
   |
LL |         #[link_section = "1800"]
   |                          ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:669:26
   |
LL |         #[link_section = "1800"]
   |                          ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:674:26
   |
LL |         #[link_section = "1800"]
   |                          ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:678:22
   |
LL |     #[link_section = "1800"]
   |                      ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

warning: attribute should be applied to an `extern` block with non-Rust ABI
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:685:1
   |
LL |   #[link(name = "x")]
   |   ^^^^^^^^^^^^^^^^^^^
...
LL | / mod link {
LL | |     //~^ NOTE not an `extern` block
LL | |
LL | |     mod inner { #![link(name = "x")] }
...  |
LL | | }
   | |_- not an `extern` block
   |
   = 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
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:70:1
   |
LL | #![link(name = "x")] //~ WARN attribute should be applied to an `extern` block
   | ^^^^^^^^^^^^^^^^^^^^ not an `extern` block
   |
   = 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 feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
---

warning: attribute should be applied to an `extern` block with non-Rust ABI
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:691:17
   |
LL |     mod inner { #![link(name = "x")] }
   |     ------------^^^^^^^^^^^^^^^^^^^^-- not an `extern` block
   |
   = 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
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:696:5
   |
LL |     #[link(name = "x")] fn f() { }
   |     ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
   |
   = 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
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:701:5
   |
LL |     #[link(name = "x")] struct S;
   |     ^^^^^^^^^^^^^^^^^^^ --------- not an `extern` block
   |
   = 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
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:706:5
   |
LL |     #[link(name = "x")] type T = S;
   |     ^^^^^^^^^^^^^^^^^^^ ----------- not an `extern` block
   |
   = 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
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:711:5
   |
LL |     #[link(name = "x")] impl S { }
   |     ^^^^^^^^^^^^^^^^^^^ ---------- not an `extern` block
   |
   = 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
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:716:5
   |
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: `#[macro_use]` attribute cannot be used on functions
---

warning: `#[macro_use]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:207:5
   |
LL |     #[macro_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!
   = help: `#[macro_use]` can be applied to crates, extern crates, and modules

---

warning: `#[macro_export]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:220:17
   |
LL |     mod inner { #![macro_export] }
   |                 ^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[macro_export]` can only be applied to macro defs

---

warning: `#[macro_export]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:244:5
   |
LL |     #[macro_export] 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!
   = help: `#[macro_export]` can only be applied to macro defs

warning: `#[path]` attribute cannot be used on functions
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:255:5
   |
LL |     #[path = "3800"] 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!
   = help: `#[path]` can only be applied to modules

warning: `#[path]` attribute cannot be used on structs
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:261:5
   |
LL |     #[path = "3800"]  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!
   = help: `#[path]` can only be applied to modules

warning: `#[path]` attribute cannot be used on type aliases
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:267:5
   |
LL |     #[path = "3800"] 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!
   = help: `#[path]` can only be applied to modules

warning: `#[path]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:273:5
   |
LL |     #[path = "3800"] 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!
   = help: `#[path]` can only be applied to modules

---

warning: `#[automatically_derived]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:286:17
   |
LL |     mod inner { #![automatically_derived] }
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[automatically_derived]` can only be applied to trait impl blocks

---

warning: `#[automatically_derived]` attribute cannot be used on traits
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:310:5
   |
LL |     #[automatically_derived] trait W { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[automatically_derived]` can only be applied to trait impl blocks

warning: `#[automatically_derived]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:316:5
   |
LL |     #[automatically_derived] 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!
   = help: `#[automatically_derived]` can only be applied to trait impl blocks

---

warning: `#[no_mangle]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:331:17
   |
LL |     mod inner { #![no_mangle] }
   |                 ^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[no_mangle]` can be applied to functions and statics

---

warning: `#[no_mangle]` attribute cannot be used on type aliases
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:345:5
   |
LL |     #[no_mangle] 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!
   = help: `#[no_mangle]` can be applied to functions and statics

warning: `#[no_mangle]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:351:5
   |
LL |     #[no_mangle] 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!
   = help: `#[no_mangle]` can be applied to functions and statics

---

warning: `#[should_panic]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:378:17
   |
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!
   = help: `#[should_panic]` can only be applied to functions

---

warning: `#[should_panic]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:398:5
   |
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!
   = help: `#[should_panic]` can only be applied to functions

---

warning: `#[ignore]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:411:17
   |
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!
   = help: `#[ignore]` can only be applied to functions

---

warning: `#[ignore]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:431:5
   |
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!
   = help: `#[ignore]` can only be applied to functions

warning: `#[no_implicit_prelude]` attribute cannot be used on functions
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:442:5
   |
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!
   = help: `#[no_implicit_prelude]` can be applied to crates and modules

---

warning: `#[no_implicit_prelude]` attribute cannot be used on type aliases
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:454:5
   |
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!
   = help: `#[no_implicit_prelude]` can be applied to crates and modules

warning: `#[no_implicit_prelude]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:460:5
   |
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!
   = help: `#[no_implicit_prelude]` can be applied to crates and modules

warning: `#[macro_escape]` attribute cannot be used on functions
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:475:5
   |
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!
   = help: `#[macro_escape]` can be applied to crates, extern crates, and modules

---

warning: `#[macro_escape]` attribute cannot be used on type aliases
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:487:5
   |
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!
   = help: `#[macro_escape]` can be applied to crates, extern crates, and modules

warning: `#[macro_escape]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:493:5
   |
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!
   = help: `#[macro_escape]` can be applied to crates, extern crates, and modules

---
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:502:1
   |
LL | / mod no_std {
LL | |     //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![no_std] }
...  |
LL | | }
   | |_^

warning: the `#![no_std]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:504:17
   |
LL |     mod inner { #![no_std] }
   |                 ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:507:5
   |
---

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:515:5
   |
LL |     #[no_std] type T = S;
   |     ^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:515:15
   |
LL |     #[no_std] type T = S;
   |               ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_std]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:519:5
   |
LL |     #[no_std] impl S { }
   |     ^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:519:15
   |
LL |     #[no_std] impl S { }
   |               ^^^^^^^^^^

warning: `#[cold]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:541:1
   |
---

warning: `#[cold]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:548:17
   |
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!
   = help: `#[cold]` can only be applied to functions

---

warning: `#[cold]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:568:5
   |
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!
   = help: `#[cold]` can only be applied to functions

---

warning: `#[link_name]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:588:17
   |
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!
   = help: `#[link_name]` can be applied to foreign functions and foreign statics

---

warning: `#[link_name]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:612:5
   |
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!
   = help: `#[link_name]` can be applied to foreign functions and foreign statics

---

warning: `#[link_section]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:625:17
   |
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!
   = help: `#[link_section]` can be applied to functions and statics

---

warning: `#[link_section]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:645:5
   |
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!
   = help: `#[link_section]` can be applied to functions and statics

---

warning: `#[must_use]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:736:1
   |
LL | #[must_use] //~ WARN attribute cannot be used on
   | ^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[must_use]` can be applied to data types, functions, and traits

warning: `#[must_use]` attribute cannot be used on modules
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:741:17
   |
LL |     mod inner { #![must_use] } //~ WARN attribute cannot be used on
   |                 ^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[must_use]` can be applied to data types, functions, and traits

warning: `#[must_use]` attribute cannot be used on type aliases
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:750:5
   |
LL |     #[must_use] type T = S; //~ WARN attribute cannot be used on
   |     ^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[must_use]` can be applied to data types, functions, and traits

warning: `#[must_use]` attribute cannot be used on inherent impl blocks
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:755:5
   |
LL |     #[must_use] impl S { } //~ WARN attribute cannot be used on
   |     ^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[must_use]` can be applied to data types, functions, and traits

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:761:1
   |
LL | #[windows_subsystem = "windows"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:763:1
   |
LL | / mod windows_subsystem {
LL | |     //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![windows_subsystem="windows"] }
...  |
LL | | }
   | |_^

warning: the `#![windows_subsystem]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:765:17
   |
LL |     mod inner { #![windows_subsystem="windows"] }
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:768:5
   |
LL |     #[windows_subsystem = "windows"] fn f() { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:768:38
   |
LL |     #[windows_subsystem = "windows"] fn f() { }
   |                                      ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:772:5
   |
LL |     #[windows_subsystem = "windows"] struct S;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this struct
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:772:38
   |
LL |     #[windows_subsystem = "windows"] struct S;
   |                                      ^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:776:5
   |
LL |     #[windows_subsystem = "windows"] type T = S;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:776:38
   |
LL |     #[windows_subsystem = "windows"] type T = S;
   |                                      ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![windows_subsystem]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:780:5
   |
LL |     #[windows_subsystem = "windows"] impl S { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:780:38
   |
LL |     #[windows_subsystem = "windows"] impl S { }
   |                                      ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:787:1
   |
LL | #[crate_name = "0900"]
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:789:1
   |
LL | / mod crate_name {
LL | | //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![crate_name="0900"] }
...  |
LL | | }
   | |_^

warning: the `#![crate_name]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:791:17
   |
LL |     mod inner { #![crate_name="0900"] }
   |                 ^^^^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:794:5
   |
LL |     #[crate_name = "0900"] fn f() { }
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:794:28
   |
LL |     #[crate_name = "0900"] fn f() { }
   |                            ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:798:5
   |
---

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:802:5
   |
LL |     #[crate_name = "0900"] type T = S;
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:802:28
   |
LL |     #[crate_name = "0900"] type T = S;
   |                            ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:806:5
   |
LL |     #[crate_name = "0900"] impl S { }
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:806:28
   |
LL |     #[crate_name = "0900"] impl S { }
   |                            ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:811:1
   |
LL | #[crate_type = "0800"]
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:813:1
   |
LL | / mod crate_type {
LL | | //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![crate_type="0800"] }
...  |
LL | | }
   | |_^

warning: the `#![crate_type]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:815:17
   |
LL |     mod inner { #![crate_type="0800"] }
   |                 ^^^^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:818:5
   |
LL |     #[crate_type = "0800"] fn f() { }
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:818:28
   |
LL |     #[crate_type = "0800"] fn f() { }
   |                            ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:822:5
   |
LL |     #[crate_type = "0800"] struct S;
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this struct
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:822:28
   |
LL |     #[crate_type = "0800"] struct S;
   |                            ^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:826:5
   |
LL |     #[crate_type = "0800"] type T = S;
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:826:28
   |
LL |     #[crate_type = "0800"] type T = S;
   |                            ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_type]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:830:5
   |
LL |     #[crate_type = "0800"] impl S { }
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:830:28
   |
LL |     #[crate_type = "0800"] impl S { }
   |                            ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:835:1
   |
LL | #[feature(x0600)]
   | ^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:837:1
   |
LL | / mod feature {
LL | | //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![feature(x0600)] }
...  |
LL | | }
   | |_^

warning: the `#![feature]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:839:17
   |
LL |     mod inner { #![feature(x0600)] }
   |                 ^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:842:5
   |
LL |     #[feature(x0600)] fn f() { }
   |     ^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:842:23
   |
LL |     #[feature(x0600)] fn f() { }
   |                       ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:846:5
   |
LL |     #[feature(x0600)] struct S;
   |     ^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this struct
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:846:23
   |
LL |     #[feature(x0600)] struct S;
   |                       ^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:850:5
   |
LL |     #[feature(x0600)] type T = S;
   |     ^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:850:23
   |
LL |     #[feature(x0600)] type T = S;
   |                       ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![feature]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:854:5
   |
LL |     #[feature(x0600)] impl S { }
   |     ^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:854:23
   |
LL |     #[feature(x0600)] impl S { }
   |                       ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:860:1
   |
LL | #[no_main]
   | ^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:862:1
   |
LL | / mod no_main_1 {
LL | |     //~^ NOTE: this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![no_main] }
...  |
LL | | }
   | |_^

warning: the `#![no_main]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:864:17
   |
LL |     mod inner { #![no_main] }
   |                 ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:867:5
   |
---

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:875:5
   |
LL |     #[no_main] type T = S;
   |     ^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:875:16
   |
LL |     #[no_main] type T = S;
   |                ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_main]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:879:5
   |
LL |     #[no_main] impl S { }
   |     ^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:879:16
   |
LL |     #[no_main] impl S { }
   |                ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:884:1
   |
LL | #[no_builtins]
   | ^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:886:1
   |
LL | / mod no_builtins {
LL | |     //~^ NOTE: this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![no_builtins] }
...  |
LL | | }
   | |_^

warning: the `#![no_builtins]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:888:17
   |
LL |     mod inner { #![no_builtins] }
   |                 ^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:891:5
   |
LL |     #[no_builtins] fn f() { }
   |     ^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:891:20
   |
LL |     #[no_builtins] fn f() { }
   |                    ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:895:5
   |
LL |     #[no_builtins] struct S;
   |     ^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this struct
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:895:20
   |
LL |     #[no_builtins] struct S;
   |                    ^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:899:5
   |
LL |     #[no_builtins] type T = S;
   |     ^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:899:20
   |
LL |     #[no_builtins] type T = S;
   |                    ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![no_builtins]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:903:5
   |
LL |     #[no_builtins] impl S { }
   |     ^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:903:20
   |
LL |     #[no_builtins] impl S { }
   |                    ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:908:1
   |
LL | #[recursion_limit="0200"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:910:1
   |
LL | / mod recursion_limit {
LL | |     //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![recursion_limit="0200"] }
...  |
LL | | }
   | |_^

warning: the `#![recursion_limit]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:912:17
   |
LL |     mod inner { #![recursion_limit="0200"] }
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:915:5
   |
LL |     #[recursion_limit="0200"] fn f() { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:915:31
   |
LL |     #[recursion_limit="0200"] fn f() { }
   |                               ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:919:5
   |
LL |     #[recursion_limit="0200"] struct S;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this struct
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:919:31
   |
LL |     #[recursion_limit="0200"] struct S;
   |                               ^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:923:5
   |
LL |     #[recursion_limit="0200"] type T = S;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this type alias
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:923:31
   |
LL |     #[recursion_limit="0200"] type T = S;
   |                               ^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![recursion_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:927:5
   |
LL |     #[recursion_limit="0200"] impl S { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:927:31
   |
LL |     #[recursion_limit="0200"] impl S { }
   |                               ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:932:1
   |
LL | #[type_length_limit="0100"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this module
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:934:1
   |
LL | / mod type_length_limit {
LL | |     //~^ NOTE this attribute does not have an `!`, which means it is applied to this module
LL | |     mod inner { #![type_length_limit="0100"] }
...  |
LL | | }
   | |_^

warning: the `#![type_length_limit]` attribute can only be used at the crate root
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:936:17
   |
LL |     mod inner { #![type_length_limit="0100"] }
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:939:5
   |
LL |     #[type_length_limit="0100"] fn f() { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this function
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:939:33
   |
LL |     #[type_length_limit="0100"] fn f() { }
   |                                 ^^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:943:5
   |
LL |     #[type_length_limit="0100"] struct S;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this struct
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:943:33
   |
LL |     #[type_length_limit="0100"] struct S;
   |                                 ^^^^^^^^^

warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![type_length_limit]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:947: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
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:947: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]`
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:951:5
   |
LL |     #[type_length_limit="0100"] impl S { }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: this attribute does not have an `!`, which means it is applied to this implementation block
  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:951:33
   |
LL |     #[type_length_limit="0100"] impl S { }
   |                                 ^^^^^^^^^^

warning: `#[should_panic]` attribute cannot be used on crates
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:49:1
   |
LL | #![should_panic] //~ WARN attribute cannot be used on
   | ^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[should_panic]` can only be applied to functions

warning: `#[ignore]` attribute cannot be used on crates
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:53:1
   |
LL | #![ignore] //~ WARN attribute cannot be used on
   | ^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[ignore]` can only be applied to functions

warning: `#[proc_macro_derive]` attribute cannot be used on crates
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:61:1
   |
LL | #![proc_macro_derive(Test)] //~ WARN attribute cannot be used on
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[proc_macro_derive]` can only be applied to functions

warning: `#[cold]` attribute cannot be used on crates
##[warning]  --> /Users/runner/work/rust/rust/tests/ui/feature-gates/issue-43106-gating-of-builtin-attrs.rs:66:1
   |
LL | #![cold] //~ WARN attribute cannot be used on
   | ^^^^^^^^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = help: `#[cold]` can only be applied to functions

---
- error: aborting due to 28 previous errors
+ error: invalid macho section specifier
+   --> $DIR/lint-unsafe-code.rs:51:18
+    |
+ LL | #[link_section = ".example_section"] fn uwu() {}
+    |                  ^^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: invalid macho section specifier
+   --> $DIR/lint-unsafe-code.rs:52:18
+    |
+ LL | #[link_section = ".example_section"] static UWU: u32 = 5;
+    |                  ^^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: aborting due to 30 previous errors
224 
225 

Note: some mismatched output was normalized before being compared
-   --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:51:18
- LL | #[link_section = ".example_section"] fn uwu() {} //~ ERROR: declaration of a function with `link_section`
-   --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:52:18
- LL | #[link_section = ".example_section"] static UWU: u32 = 5; //~ ERROR: declaration of a static with `link_section`
+ error: invalid macho section specifier
+   --> $DIR/lint-unsafe-code.rs:51:18
+    |
+ LL | #[link_section = ".example_section"] fn uwu() {}
+    |                  ^^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: invalid macho section specifier
+   --> $DIR/lint-unsafe-code.rs:52:18
+    |
+ LL | #[link_section = ".example_section"] static UWU: u32 = 5;
+    |                  ^^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: aborting due to 30 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lint/lint-unsafe-code.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/lint/lint-unsafe-code" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error: declaration of a `no_mangle` function
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:31:1
   |
LL | #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` function
   | ^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
note: the lint level is defined here
  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:3:9
   |
LL | #![deny(unsafe_code)]
   |         ^^^^^^^^^^^

error: declaration of a `no_mangle` static
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:32:1
   |
LL | #[no_mangle] static FOO: u32 = 5; //~ ERROR: declaration of a `no_mangle` static
   | ^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of a `no_mangle` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:41:5
   |
LL |     #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` method
   |     ^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of a `no_mangle` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:45:5
   |
LL |     #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` method
   |     ^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of a function with `export_name`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:48:1
   |
LL | #[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a function with `export_name`
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of a static with `export_name`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:49:1
   |
LL | #[export_name = "BAR"] static BAR: u32 = 5; //~ ERROR: declaration of a static with `export_name`
   | ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of a function with `link_section`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:51:1
   |
LL | #[link_section = ".example_section"] fn uwu() {} //~ ERROR: declaration of a function with `link_section`
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them

error: declaration of a static with `link_section`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:52:1
   |
LL | #[link_section = ".example_section"] static UWU: u32 = 5; //~ ERROR: declaration of a static with `link_section`
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them

error: declaration of a method with `export_name`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:57:5
   |
LL |     #[export_name = "bar"] fn bar() {} //~ ERROR: declaration of a method with `export_name`
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of a method with `export_name`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:61:5
   |
LL |     #[export_name = "bar"] fn foo() {} //~ ERROR: declaration of a method with `export_name`
   |     ^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them

error: declaration of an `unsafe` function
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:64:1
   |
LL | unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function
   | ^^^^^^^^^^^^^^^^^^

error: declaration of an `unsafe` trait
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:65:1
   |
LL | unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait
   | ^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` trait
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:66:1
   |
LL | unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: declaration of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:69:5
   |
LL |     unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:70:5
   |
LL |     unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:71:5
   |
LL |     unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:75:5
   |
LL |     unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:76:5
   |
LL |     unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:95:5
   |
LL |     unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:106:5
   |
LL |     unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:112:5
   |
LL |     unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: implementation of an `unsafe` method
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:116:5
   |
LL |     unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method
   |     ^^^^^^^^^^^^^^^^^^^^^^^

error: usage of an `unsafe` block
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:127:5
   |
LL |     unsafe {} //~ ERROR: usage of an `unsafe` block
   |     ^^^^^^^^^

error: declaration of a `no_mangle` function
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:21:9
   |
LL |         #[no_mangle] fn foo() {} //~ ERROR: declaration of a `no_mangle` function
   |         ^^^^^^^^^^^^
...
LL |     unsafe_in_macro!()
   |     ------------------ in this macro invocation
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
   = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error: declaration of a `no_mangle` static
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:22:9
   |
LL |         #[no_mangle] static FOO: u32 = 5; //~ ERROR: declaration of a `no_mangle` static
   |         ^^^^^^^^^^^^
...
LL |     unsafe_in_macro!()
   |     ------------------ in this macro invocation
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
   = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error: declaration of a function with `export_name`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:23:9
   |
LL |         #[export_name = "bar"] fn bar() {}
   |         ^^^^^^^^^^^^^^^^^^^^^^
...
LL |     unsafe_in_macro!()
   |     ------------------ in this macro invocation
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
   = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error: declaration of a static with `export_name`
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:25:9
   |
LL |         #[export_name = "BAR"] static BAR: u32 = 5;
   |         ^^^^^^^^^^^^^^^^^^^^^^
...
LL |     unsafe_in_macro!()
   |     ------------------ in this macro invocation
   |
   = note: the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
   = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error: usage of an `unsafe` block
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:27:9
   |
LL |         unsafe {} //~ ERROR: usage of an `unsafe` block
   |         ^^^^^^^^^
...
LL |     unsafe_in_macro!()
   |     ------------------ in this macro invocation
   |
   = note: this error originates in the macro `unsafe_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:51:18
   |
LL | #[link_section = ".example_section"] fn uwu() {} //~ ERROR: declaration of a function with `link_section`
   |                  ^^^^^^^^^^^^^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/lint-unsafe-code.rs:52:18
   |
LL | #[link_section = ".example_section"] static UWU: u32 = 5; //~ ERROR: declaration of a static with `link_section`
   |                  ^^^^^^^^^^^^^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: aborting due to 30 previous errors
------------------------------------------

---- [ui] tests/ui/lint/lint-unsafe-code.rs stdout end ----
---
+    |
+ LL | #[link_section = ".text"]
+    |                  ^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: invalid macho section specifier
+   --> $DIR/unused-attr-duplicate.rs:112:18
+    |
+ LL | #[link_section = ".bss"]
+    |                  ^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
19 error: unused attribute
20   --> $DIR/unused-attr-duplicate.rs:37:1
21    |

215    | ^^^^^^^
216 
217 error: unused attribute
-   --> $DIR/unused-attr-duplicate.rs:112:1
-    |
- LL | #[link_section = ".bss"]
-    | ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
-    |
- note: attribute also specified here
-   --> $DIR/unused-attr-duplicate.rs:111:1
-    |
---
+    |
+ LL | #[link_section = ".text"]
+    |                  ^^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: invalid macho section specifier
+   --> $DIR/unused-attr-duplicate.rs:112:18
+    |
+ LL | #[link_section = ".bss"]
+    |                  ^^^^^^ not a valid macho section specifier
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+ 
+ error: aborting due to 26 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args lint/unused/unused-attr-duplicate.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/lint/unused/unused-attr-duplicate" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "-L" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/lint/unused/unused-attr-duplicate/auxiliary" "--test"
stdout: none
--- stderr -------------------------------
error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:14:1
   |
---
   |
LL | #[link_section = ".text"]
   |                  ^^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:112:18
   |
LL | #[link_section = ".bss"]
   |                  ^^^^^^ not a valid macho section specifier
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:37:1
   |
LL | #[no_link] //~ ERROR unused attribute
   | ^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:36:1
   |
LL | #[no_link]
   | ^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:41:1
   |
LL | #[macro_use] //~ ERROR unused attribute
   | ^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:40:1
   |
LL | #[macro_use]
   | ^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:44:5
   |
LL |     #[macro_export] //~ ERROR unused attribute
   |     ^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:43:5
   |
LL |     #[macro_export]
   |     ^^^^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:51:1
   |
LL | #[path = "bar.rs"] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:50:1
   |
LL | #[path = "auxiliary/lint_unused_extern_crate.rs"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:57:1
   |
LL | #[ignore = "some text"] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:56:1
   |
LL | #[ignore]
   | ^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:59:1
   |
LL | #[should_panic(expected = "values don't match")] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:58:1
   |
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!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:64:1
   |
LL | #[must_use = "some message"]  //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:63:1
   |
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!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:70:1
   |
LL | #[non_exhaustive] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:69:1
   |
LL | #[non_exhaustive]
   | ^^^^^^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:76:1
   |
LL | #[automatically_derived] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:75:1
   |
LL | #[automatically_derived]
   | ^^^^^^^^^^^^^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:80:1
   |
LL | #[inline(never)] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:79:1
   |
LL | #[inline(always)]
   | ^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:83:1
   |
LL | #[cold] //~ ERROR unused attribute
   | ^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:82:1
   |
LL | #[cold]
   | ^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:85:1
   |
LL | #[track_caller] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:84:1
   |
LL | #[track_caller]
   | ^^^^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:93:5
   |
LL |     #[link_name = "rust_dbg_extern_identity_u32"] //~ ERROR unused attribute
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:92:5
   |
LL |     #[link_name = "this_does_not_exist"]
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:99:1
   |
LL | #[export_name = "exported_symbol_name2"]  //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:98:1
   |
LL | #[export_name = "exported_symbol_name"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:104:1
   |
LL | #[no_mangle] //~ ERROR unused attribute
   | ^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:103:1
   |
LL | #[no_mangle]
   | ^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:108:1
   |
LL | #[used] //~ ERROR unused attribute
   | ^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:107:1
   |
---
   |
LL | #![crate_name = "unused_attr_duplicate"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:21:1
   |
LL | #![recursion_limit = "256"] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:20:1
   |
LL | #![recursion_limit = "128"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:24:1
   |
LL | #![type_length_limit = "1"] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:23:1
   |
LL | #![type_length_limit = "1048576"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:27:1
   |
LL | #![no_std] //~ ERROR unused attribute
   | ^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:26:1
   |
LL | #![no_std]
   | ^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:29:1
   |
LL | #![no_implicit_prelude] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:28:1
   |
LL | #![no_implicit_prelude]
   | ^^^^^^^^^^^^^^^^^^^^^^^

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:31:1
   |
LL | #![windows_subsystem = "windows"] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:30:1
   |
LL | #![windows_subsystem = "console"]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!

error: unused attribute
##[error]  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:34:1
   |
LL | #![no_builtins] //~ ERROR unused attribute
   | ^^^^^^^^^^^^^^^ help: remove this attribute
   |
note: attribute also specified here
  --> /Users/runner/work/rust/rust/tests/ui/lint/unused/unused-attr-duplicate.rs:33:1
   |
---
+    |
+ LL |         #[cfg_attr(true, link_section = ".custom_section")]
+    |                                         ^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+ ...
+ LL | with_cfg_attr!();
+    | ---------------- in this macro invocation
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+    = note: this error originates in the macro `with_cfg_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
+ 
1 error: unsafe attribute used without unsafe
2   --> $DIR/unsafe-attributes-fix.rs:53:6
3    |

---
+    |
+ LL |         #[cfg_attr(true, link_section = ".custom_section")]
+    |                                         ^^^^^^^^^^^^^^^^^ not a valid macho section specifier
+ ...
+ LL | with_cfg_attr!();
+    | ---------------- in this macro invocation
+    |
+    = note: a macho section specifier requires a segment and a section, separated by a comma
+    = help: an example of a valid macho section specifier is `__TEXT,__cstring`
+    = note: this error originates in the macro `with_cfg_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
+ 
+ error: aborting due to 8 previous errors


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args rust-2024/unsafe-attributes/unsafe-attributes-fix.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2/bin/rustc" "/Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/Users/runner/work/rust/rust/vendor" "--sysroot" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/stage2" "--target=aarch64-apple-darwin" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/Users/runner/work/rust/rust/build/aarch64-apple-darwin/test/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "incomplete_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/Users/runner/work/rust/rust/build/aarch64-apple-darwin/native/rust-test-helpers" "--edition=2015"
stdout: none
--- stderr -------------------------------
error: invalid macho section specifier
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:46:41
   |
LL |         #[cfg_attr(true, link_section = ".custom_section")]
   |                                         ^^^^^^^^^^^^^^^^^ not a valid macho section specifier
...
LL | with_cfg_attr!();
   | ---------------- in this macro invocation
   |
   = note: a macho section specifier requires a segment and a section, separated by a comma
   = help: an example of a valid macho section specifier is `__TEXT,__cstring`
   = note: this error originates in the macro `with_cfg_attr` (in Nightly builds, run with -Z macro-backtrace for more info)

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:53:6
   |
LL | tt!([no_mangle]);
   |      ^^^^^^^^^ usage of unsafe attribute
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html>
note: the lint level is defined here
  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:3:9
   |
LL | #![deny(unsafe_attr_outside_unsafe)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: wrap the attribute in `unsafe(...)`
   |
LL | tt!([unsafe(no_mangle)]);
   |      +++++++         +

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:14:11
   |
LL |         #[$e]
   |           ^^ usage of unsafe attribute
...
LL | ident!(no_mangle);
   | ----------------- in this macro invocation
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html>
   = note: this error originates in the macro `ident` (in Nightly builds, run with -Z macro-backtrace for more info)
---

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:57:7
   |
LL | meta!(no_mangle);
   |       ^^^^^^^^^ usage of unsafe attribute
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html>
help: wrap the attribute in `unsafe(...)`
   |
LL | meta!(unsafe(no_mangle));
   |       +++++++         +

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:60:8
   |
LL | meta2!(export_name = "baw");
   |        ^^^^^^^^^^^ usage of unsafe attribute
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html>
help: wrap the attribute in `unsafe(...)`
   |
LL | meta2!(unsafe(export_name = "baw"));
   |        +++++++                   +

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:23:11
   |
LL |         #[$e = $l]
   |           ^^ usage of unsafe attribute
...
LL | ident2!(export_name, "bars");
   | ---------------------------- in this macro invocation
   |
   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html>
   = note: this error originates in the macro `ident2` (in Nightly builds, run with -Z macro-backtrace for more info)
help: wrap the attribute in `unsafe(...)`
   |
LL |         #[unsafe($e = $l)]
   |           +++++++       +

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:46:26
   |
---
   = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-attributes.html>
   = note: this error originates in the macro `with_cfg_attr` (in Nightly builds, run with -Z macro-backtrace for more info)
help: wrap the attribute in `unsafe(...)`
   |
LL |         #[cfg_attr(true, unsafe(link_section = ".custom_section"))]
   |                          +++++++                                +

error: unsafe attribute used without unsafe
##[error]  --> /Users/runner/work/rust/rust/tests/ui/rust-2024/unsafe-attributes/unsafe-attributes-fix.rs:67:3
   |

@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 10, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

💔 Test for ee627eb failed: CI. Failed job:

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 10, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 10, 2026

PR #155065, which is a member of this rollup, was unapproved.

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants