rust/tests/ui/rust-2018
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
..
auxiliary Move tests from /ui directory 2025-04-29 18:19:26 +02:00
edition-lint-inter-outlives diagnostics: do not warn when a lifetime bound infers itself 2024-08-09 16:16:16 -07:00
uniform-paths Detect unused struct impls pub trait 2024-03-10 23:30:53 +08:00
async-ident-allowed.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
async-ident-allowed.stderr Deny gen keyword in edition_2024_compat lints 2024-04-22 11:51:50 -04:00
async-ident.fixed Make sure we don't deny macro vars w keyword names 2024-05-07 19:13:33 -04:00
async-ident.rs Make sure we don't deny macro vars w keyword names 2024-05-07 19:13:33 -04:00
async-ident.stderr Make sure we don't deny macro vars w keyword names 2024-05-07 19:13:33 -04:00
dyn-keyword.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dyn-keyword.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dyn-keyword.stderr Deny gen keyword in edition_2024_compat lints 2024-04-22 11:51:50 -04:00
dyn-trait-compatibility.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
dyn-trait-compatibility.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
edition-lint-fully-qualified-paths.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-fully-qualified-paths.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-fully-qualified-paths.stderr Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
edition-lint-nested-empty-paths.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-nested-empty-paths.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-nested-empty-paths.stderr Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
edition-lint-nested-paths.fixed UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
edition-lint-nested-paths.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
edition-lint-nested-paths.stderr Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
edition-lint-paths-2018.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-paths.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-paths.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
edition-lint-paths.stderr Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
edition-lint-uninferable-outlives.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-idiomatic-in-2018.fixed If suggestion would leave an empty line, delete it 2024-03-01 13:48:20 +00:00
extern-crate-idiomatic-in-2018.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-idiomatic-in-2018.stderr Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
extern-crate-idiomatic.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-idiomatic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-referenced-by-self-path.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-referenced-by-self-path.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-rename.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-rename.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-rename.stderr Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
extern-crate-submod.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-submod.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
extern-crate-submod.stderr Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
future-proofing-locals.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
future-proofing-locals.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-51008-1.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-51008.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-52202-use-suggestions.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-52202-use-suggestions.stderr Tweak output of import suggestions 2024-06-13 20:22:21 +00:00
issue-54006.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-54006.stderr Supress unhelpful diagnostics for unresolved top level attributes 2024-01-29 17:43:07 +08:00
issue-54400-unused-extern-crate-attr-span.fixed compiletest: add enable-by-default check-cfg 2024-05-04 11:30:38 +02:00
issue-54400-unused-extern-crate-attr-span.rs Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
issue-54400-unused-extern-crate-attr-span.stderr Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
local-path-suggestions-2015.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
local-path-suggestions-2015.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
local-path-suggestions-2018.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
local-path-suggestions-2018.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
macro-use-warned-against.rs Spruce up the diagnostics of some early lints 2024-06-03 07:25:32 +02:00
macro-use-warned-against.stderr Spruce up the diagnostics of some early lints 2024-06-03 07:25:32 +02:00
proc-macro-crate-in-paths.rs Add needs-unwind for proc macro tests 2024-03-25 15:02:55 +00:00
remove-extern-crate.fixed By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
remove-extern-crate.rs By tracking import use types to check whether it is scope uses or the other situations like module-relative uses, we can do more accurate redundant import checking. 2024-02-18 16:38:11 +08:00
remove-extern-crate.stderr Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
removing-extern-crate-malformed-cfg.fixed Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
removing-extern-crate-malformed-cfg.rs Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
removing-extern-crate-malformed-cfg.stderr Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
removing-extern-crate.fixed Move tests from /ui directory 2025-04-29 18:19:26 +02:00
removing-extern-crate.rs Move tests from /ui directory 2025-04-29 18:19:26 +02:00
removing-extern-crate.stderr Use cfg_attr AST placeholder AST cfg_attr_trace for diagnostics 2025-05-29 10:24:23 +00:00
suggestions-not-always-applicable.fixed Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
suggestions-not-always-applicable.rs Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
trait-import-suggestions.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
trait-import-suggestions.stderr Trim suggestion parts to the subset that is purely additive 2025-02-14 00:44:10 -08:00
try-ident.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
try-ident.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
try-ident.stderr Deny gen keyword in edition_2024_compat lints 2024-04-22 11:51:50 -04:00
try-macro.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
try-macro.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
try-macro.stderr Deny gen keyword in edition_2024_compat lints 2024-04-22 11:51:50 -04:00
unresolved-asterisk-imports.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unresolved-asterisk-imports.stderr Reword "crate not found" resolve message 2025-01-24 01:19:50 +00:00