File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
tests/ui/attributes/unsafe Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ // This is a regression test for https://github.com/rust-lang/rust/issues/148453
2+ // We want the `cannot find attribute` error to appear before `is not an unsafe attribute`
3+ //@ edition: 2024
4+
5+ #[ unsafe( does_not_exist) ]
6+ //~^ ERROR cannot find attribute
7+ //~| ERROR is not an unsafe attribute
8+ fn aa ( ) { }
9+
10+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error: cannot find attribute `does_not_exist` in this scope
2+ --> $DIR/unsafe-nonexistent-attribute.rs:5:10
3+ |
4+ LL | #[unsafe(does_not_exist)]
5+ | ^^^^^^^^^^^^^^
6+
7+ error: `does_not_exist` is not an unsafe attribute
8+ --> $DIR/unsafe-nonexistent-attribute.rs:5:3
9+ |
10+ LL | #[unsafe(does_not_exist)]
11+ | ^^^^^^ this is not an unsafe attribute
12+ |
13+ = note: extraneous unsafe is not allowed in attributes
14+
15+ error: aborting due to 2 previous errors
16+
You can’t perform that action at this time.
0 commit comments