rust/tests/ui/imports/extern-crate-used.stderr
Esteban Küber f80e3ac4ed Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics
PR 138515, we insert a placeholder attribute so that checks for attributes can still know about the placement of `cfg` attributes. When we suggest removing items with `cfg_attr`s (fix Issue 56328) and make them verbose. We tweak the wording of the existing "unused `extern crate`" lint.

```
warning: unused extern crate
  --> $DIR/removing-extern-crate.rs:9:1
   |
LL | extern crate removing_extern_crate as foo;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused
   |
note: the lint level is defined here
  --> $DIR/removing-extern-crate.rs:6:9
   |
LL | #![warn(rust_2018_idioms)]
   |         ^^^^^^^^^^^^^^^^
   = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]`
help: remove the unused `extern crate`
   |
LL - #[cfg_attr(test, macro_use)]
LL - extern crate removing_extern_crate as foo;
LL +
   |
```
2025-05-29 10:24:23 +00:00

20 lines
397 B
Plaintext

error: unused extern crate
--> $DIR/extern-crate-used.rs:18:1
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^ unused
|
note: the lint level is defined here
--> $DIR/extern-crate-used.rs:6:9
|
LL | #![deny(unused_extern_crates)]
| ^^^^^^^^^^^^^^^^^^^^
help: remove the unused `extern crate`
|
LL - extern crate core;
LL +
|
error: aborting due to 1 previous error