rust/compiler/rustc_expand/src
bors fd20513f52 Auto merge of #92473 - petrochenkov:ltrattr2, r=Aaron1011
expand: Pick `cfg`s and `cfg_attrs` one by one, like other attributes

This is a rebase of https://github.com/rust-lang/rust/pull/83354, but without any language-changing parts ~(except for https://github.com/rust-lang/rust/pull/84110)~, i.e. the attribute expansion order is the same.

This is a pre-requisite for any other changes making cfg attributes closer to regular macro attributes
- Possibly changing their expansion order (https://github.com/rust-lang/rust/issues/83331)
- Keeping macro backtraces for cfg attributes, or otherwise making them visible after expansion without keeping them in place literally (https://github.com/rust-lang/rust/pull/84110).

Two exceptions to the "one by one" behavior are:
- cfgs eagerly expanded by `derive` and `cfg_eval`, they are still expanded in a batch, that's by design.
- cfgs at the crate root, they are currently expanded not during the main expansion pass, but before that, during `#![feature]` collection. I'll try to disentangle that logic later in a separate PR.

r? `@Aaron1011`
2022-01-17 02:06:54 +00:00
..
mbe Remove redundant [..]s 2021-12-09 00:01:29 +01:00
mut_visit rustc_ast: Turn MutVisitor::token_visiting_enabled into a constant 2021-10-18 00:23:24 +03:00
parse re-format with new rustfmt 2021-11-30 13:08:41 -05:00
tokenstream Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
base.rs expand: Turn ast::Crate into a first class expansion target 2021-11-28 15:48:55 +08:00
build.rs Detect bare blocks with type ascription that were meant to be a struct literal 2021-09-03 14:43:04 +00:00
config.rs expand: Pick cfgs and cfg_attrs one by one, like other attributes 2022-01-10 18:11:44 +08:00
expand.rs expand: Pick cfgs and cfg_attrs one by one, like other attributes 2022-01-10 18:11:44 +08:00
lib.rs expand: Refactor InvocationCollector visitor for better code reuse 2022-01-07 14:41:22 +08:00
mbe.rs fix few typos 2021-04-19 15:57:08 +03:00
module.rs Remove unnecessary sigils around Ident::as_str() calls. 2021-12-15 17:32:42 +11:00
placeholders.rs expand: Rename some AstFragments to match AST structures 2022-01-07 13:50:03 +08:00
proc_macro_server.rs eplace usages of vec![].into_iter with [].into_iter 2022-01-09 14:09:25 +11:00
proc_macro.rs proc_macro: Add an expand_expr method to TokenStream 2021-11-12 15:41:40 -05:00
tests.rs Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00