rust/compiler/rustc_resolve/src
Matthias Krüger 7aba37da44
Rollup merge of #133823 - estebank:issue-56328, r=petrochenkov
Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion

In rust-lang/rust#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 rust-lang/rust#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;
   |
```

r? `@petrochenkov`

try-job: x86_64-gnu-aux
2025-05-30 07:01:27 +02:00
..
late Rollup merge of #141213 - xizheyin:issue-141136, r=nnethercote 2025-05-21 11:28:45 +02:00
build_reduced_graph.rs Reorder ast::ItemKind::{Struct,Enum,Union} fields. 2025-05-28 15:48:45 +10:00
check_unused.rs Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
def_collector.rs Reorder ast::ItemKind::{Struct,Enum,Union} fields. 2025-05-28 15:48:45 +10:00
diagnostics.rs consider glob imports in cfg suggestion 2025-05-28 00:59:47 +08:00
effective_visibilities.rs Reorder ast::ItemKind::{Struct,Enum,Union} fields. 2025-05-28 15:48:45 +10:00
errors.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
ident.rs Avoid an empty trait name in impl blocks. 2025-04-09 15:01:14 +10:00
imports.rs resolve: Support imports of associated types and glob imports from traits 2025-05-02 15:59:38 +03:00
late.rs Reorder ast::ItemKind::{Struct,Enum,Union} fields. 2025-05-28 15:48:45 +10:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
macros.rs Remove rustc_attr_data_structures re-export from rustc_attr_parsing 2025-05-18 18:14:43 +02:00
rustdoc.rs Rollup merge of #141376 - nnethercote:rename-kw-Empty, r=petrochenkov 2025-05-23 13:34:20 +02:00