rust/tests/ui/cfg
Nilstrieb a647ba250a Remember names of cfg-ed out items to mention them in diagnostics
`#[cfg]`s are frequently used to gate crate content behind cargo
features. This can lead to very confusing errors when features are
missing. For example, `serde` doesn't have the `derive` feature by
default. Therefore, `serde::Serialize` fails to resolve with a generic
error, even though the macro is present in the docs.

This commit adds a list of all stripped item names to metadata. This is
filled during macro expansion and then, through a fed query, persisted
in metadata. The downstream resolver can then access the metadata to
look at possible candidates for mentioning in the errors.

This slightly increases metadata (800k->809k for the feature-heavy
windows crate), but not enough to really matter.
2023-06-01 19:17:19 +02:00
..
assume-incomplete-release
auxiliary Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
cfg_attr.rs
cfg_false_no_std.rs
cfg_inner_static.rs
cfg_stmt_expr.rs
cfg-attr-cfg.rs
cfg-attr-crate.rs
cfg-false-feature.rs
cfg-false-feature.stderr
cfg-family.rs
cfg-in-crate-1.rs
cfg-macros-foo.rs
cfg-macros-notfoo.rs
cfg-match-arm.rs
cfg-method-receiver-ok.rs
cfg-method-receiver.rs
cfg-method-receiver.stderr
cfg-panic-abort.rs
cfg-panic.rs
cfg-path-error.rs
cfg-path-error.stderr
cfg-stmt-recovery.rs
cfg-stmt-recovery.stderr
cfg-target-abi.rs
cfg-target-compact-errors.rs
cfg-target-compact-errors.stderr
cfg-target-compact.rs
cfg-target-family.rs
cfg-target-vendor.rs
cfgs-on-items.rs
conditional-compile-arch.rs
conditional-compile.rs
crt-static-off-works.rs
crt-static-on-works.rs
diagnostics-cross-crate.rs Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-cross-crate.stderr Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-not-a-def.rs Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-not-a-def.stderr Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-reexport.rs Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-reexport.stderr Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-same-crate.rs Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
diagnostics-same-crate.stderr Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
expanded-cfg.rs
future-compat-crate-attributes-using-cfg_attr.rs
future-compat-crate-attributes-using-cfg_attr.stderr