rust/compiler/rustc_ast/src
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
..
attr Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
expand Remember names of cfg-ed out items to mention them in diagnostics 2023-06-01 19:17:19 +02:00
util Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
ast_traits.rs Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
ast.rs Use Option::is_some_and and Result::is_ok_and in the compiler 2023-05-24 14:20:41 +00:00
entry.rs Fixup missing renames from #[main] to #[rustc_main] 2022-06-22 18:24:09 +02:00
format.rs Fix typos in compiler 2023-04-10 22:02:52 +02:00
lib.rs make rustc compilable 2023-04-16 07:25:13 +00:00
mut_visit.rs Rip it out 2023-05-01 16:15:13 +08:00
node_id.rs Various minor Idx-related tweaks 2023-04-16 02:42:50 -07:00
ptr.rs make rustc compilable 2023-04-16 07:25:13 +00:00
token.rs Add warn-by-default lint for local binding shadowing exported glob re-export item 2023-05-27 18:49:07 +08:00
tokenstream.rs refactor: add chunks method to TokenStream to obviate rustdoc clones 2023-05-13 16:59:28 -05:00
visit.rs misc nameres changes for anon consts 2023-05-05 21:31:35 +01:00