rust/compiler/rustc_expand/src
Matthias Krüger 52868368dd
Rollup merge of #143984 - JonathanBrouwer:fix-feature-gate-ice, r=Urgau
Fix ice for feature-gated `cfg` attributes applied to the crate

This PR fixes two fixes:
1. When a feature gated option of the `cfg` attribute is applied to the crate, an ICE would occur because features are not yet available at that stage. This is fixed by ignoring the feature gate at that point, the attribute will later be re-checked (this was already done) when the feature gate is available. Fixes https://github.com/rust-lang/rust/issues/143977
2. Errors and lints on the `cfg` attribute applied to the crate would be produced twice, because of the re-checking. This is fixed by not producing any errors and lints during the first run.

The added regression test checks both problems.
r? ``@jdonszelmann``
2025-07-17 10:41:49 +02:00
..
mbe Auto merge of #143461 - folkertdev:cfg-select-builtin-macro, r=petrochenkov 2025-07-13 18:34:13 +00:00
base.rs resolve: Change &mut Resolver to &Resolver when possible 2025-07-17 02:09:01 +03:00
build.rs Replace kw_span by full span. 2025-07-03 14:59:27 +00:00
config.rs Fix ice for feature-gated cfg attributes applied to the crate 2025-07-15 23:28:15 +02:00
errors.rs mbe: Refactor the diagnostic for unrecognized metavariable expressions 2025-07-09 21:11:09 -04:00
expand.rs Fix ice for feature-gated cfg attributes applied to the crate 2025-07-15 23:28:15 +02:00
lib.rs Introduce -Zmacro-stats. 2025-06-12 21:17:17 +10:00
mbe.rs mbe: Clean up code with non-optional NonterminalKind 2025-06-24 04:37:36 -04:00
module.rs Reject macro calls inside of #![crate_name] 2025-02-15 16:47:30 +01:00
placeholders.rs completely deduplicate Visitor and MutVisitor 2025-06-19 17:50:44 +08:00
proc_macro.rs Do not get proc_macro from the sysroot in rustc 2025-05-27 15:49:28 +00:00
proc_macro_server.rs setup CI and tidy to use typos for spellchecking and fix few typos 2025-07-03 10:51:06 +03:00
stats.rs Tweak -Zmacro-stats measurement. 2025-06-24 08:42:14 +10:00