@@ -636,6 +636,15 @@ impl Builder<'_> {
636
636
for ( restricted_mode, name, values) in EXTRA_CHECK_CFGS {
637
637
if restricted_mode. is_none ( ) || * restricted_mode == Some ( mode) {
638
638
rustflags. arg ( & check_cfg_arg ( name, * values) ) ;
639
+
640
+ if * name == "bootstrap" {
641
+ // Cargo doesn't pass RUSTFLAGS to proc_macros:
642
+ // https://github.com/rust-lang/cargo/issues/4423
643
+ // Thus, if we are on stage 0, we explicitly set `--cfg=bootstrap`.
644
+ // We also declare that the flag is expected, which we need to do to not
645
+ // get warnings about it being unexpected.
646
+ hostflags. arg ( check_cfg_arg ( name, * values) ) ;
647
+ }
639
648
}
640
649
}
641
650
@@ -645,13 +654,6 @@ impl Builder<'_> {
645
654
if stage == 0 {
646
655
hostflags. arg ( "--cfg=bootstrap" ) ;
647
656
}
648
- // Cargo doesn't pass RUSTFLAGS to proc_macros:
649
- // https://github.com/rust-lang/cargo/issues/4423
650
- // Thus, if we are on stage 0, we explicitly set `--cfg=bootstrap`.
651
- // We also declare that the flag is expected, which we need to do to not
652
- // get warnings about it being unexpected.
653
- hostflags. arg ( "-Zunstable-options" ) ;
654
- hostflags. arg ( "--check-cfg=cfg(bootstrap)" ) ;
655
657
656
658
// FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
657
659
// but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See
0 commit comments