diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-03 17:37:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-03 17:37:44 +0100 |
| commit | b1e680650e93f6ac93bde358bbbc5e5e4122b342 (patch) | |
| tree | 00983877a3a10a0db357a05f6707d1ab6424f94e /src | |
| parent | ed9a21eb0c1b18b1b108351f3154dfff432a4e3b (diff) | |
| parent | 59cc6cd4acd2e9ccbdbc8e78c26d2ac9e0b00f89 (diff) | |
| download | rust-b1e680650e93f6ac93bde358bbbc5e5e4122b342.tar.gz rust-b1e680650e93f6ac93bde358bbbc5e5e4122b342.zip | |
Rollup merge of #105200 - cjgillot:issue-104562, r=compiler-errors
Remove useless filter in unused extern crate check. Fixes https://github.com/rust-lang/rust/issues/104562
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/attributes/unused-item-in-attr.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/attributes/unused-item-in-attr.stderr | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/test/ui/attributes/unused-item-in-attr.rs b/src/test/ui/attributes/unused-item-in-attr.rs new file mode 100644 index 00000000000..70dcd5413f1 --- /dev/null +++ b/src/test/ui/attributes/unused-item-in-attr.rs @@ -0,0 +1,6 @@ +#[w = { extern crate alloc; }] +//~^ ERROR unexpected expression: `{ +//~| ERROR cannot find attribute `w` in this scope +fn f() {} + +fn main() {} diff --git a/src/test/ui/attributes/unused-item-in-attr.stderr b/src/test/ui/attributes/unused-item-in-attr.stderr new file mode 100644 index 00000000000..92a8f585821 --- /dev/null +++ b/src/test/ui/attributes/unused-item-in-attr.stderr @@ -0,0 +1,16 @@ +error: unexpected expression: `{ + extern crate alloc; + }` + --> $DIR/unused-item-in-attr.rs:1:7 + | +LL | #[w = { extern crate alloc; }] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: cannot find attribute `w` in this scope + --> $DIR/unused-item-in-attr.rs:1:3 + | +LL | #[w = { extern crate alloc; }] + | ^ + +error: aborting due to 2 previous errors + |
