diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/imports/unused-import-issue-87973.fixed | 8 | ||||
| -rw-r--r-- | src/test/ui/imports/unused-import-issue-87973.rs | 11 | ||||
| -rw-r--r-- | src/test/ui/imports/unused-import-issue-87973.stderr | 14 |
3 files changed, 33 insertions, 0 deletions
diff --git a/src/test/ui/imports/unused-import-issue-87973.fixed b/src/test/ui/imports/unused-import-issue-87973.fixed new file mode 100644 index 00000000000..5c194d18aca --- /dev/null +++ b/src/test/ui/imports/unused-import-issue-87973.fixed @@ -0,0 +1,8 @@ +// run-rustfix +#![deny(unused_imports)] + +// Check that attributes get removed too. See #87973. + +//~^ ERROR unused import + +fn main() {} diff --git a/src/test/ui/imports/unused-import-issue-87973.rs b/src/test/ui/imports/unused-import-issue-87973.rs new file mode 100644 index 00000000000..c31f0f9796e --- /dev/null +++ b/src/test/ui/imports/unused-import-issue-87973.rs @@ -0,0 +1,11 @@ +// run-rustfix +#![deny(unused_imports)] + +// Check that attributes get removed too. See #87973. +#[deprecated] +#[allow(unsafe_code)] +#[cfg(not(foo))] +use std::fs; +//~^ ERROR unused import + +fn main() {} diff --git a/src/test/ui/imports/unused-import-issue-87973.stderr b/src/test/ui/imports/unused-import-issue-87973.stderr new file mode 100644 index 00000000000..81b7ea79191 --- /dev/null +++ b/src/test/ui/imports/unused-import-issue-87973.stderr @@ -0,0 +1,14 @@ +error: unused import: `std::fs` + --> $DIR/unused-import-issue-87973.rs:8:5 + | +LL | use std::fs; + | ^^^^^^^ + | +note: the lint level is defined here + --> $DIR/unused-import-issue-87973.rs:2:9 + | +LL | #![deny(unused_imports)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + |
