@@ -791,6 +791,11 @@ impl<'a> Builder<'a> {
791
791
rustflags. arg ( "--cfg=bootstrap" ) ;
792
792
}
793
793
794
+ // FIXME: It might be better to use the same value for both `RUSTFLAGS` and `RUSTDOCFLAGS`,
795
+ // but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See
796
+ // #71458.
797
+ let rustdocflags = rustflags. clone ( ) ;
798
+
794
799
if let Ok ( s) = env:: var ( "CARGOFLAGS" ) {
795
800
cargo. args ( s. split_whitespace ( ) ) ;
796
801
}
@@ -1269,7 +1274,7 @@ impl<'a> Builder<'a> {
1269
1274
}
1270
1275
}
1271
1276
1272
- Cargo { command : cargo, rustflags }
1277
+ Cargo { command : cargo, rustflags, rustdocflags }
1273
1278
}
1274
1279
1275
1280
/// Ensure that a given step is built, returning its output. This will
@@ -1327,7 +1332,7 @@ impl<'a> Builder<'a> {
1327
1332
#[ cfg( test) ]
1328
1333
mod tests;
1329
1334
1330
- #[ derive( Debug ) ]
1335
+ #[ derive( Debug , Clone ) ]
1331
1336
struct Rustflags ( String ) ;
1332
1337
1333
1338
impl Rustflags {
@@ -1367,6 +1372,7 @@ impl Rustflags {
1367
1372
pub struct Cargo {
1368
1373
command : Command ,
1369
1374
rustflags : Rustflags ,
1375
+ rustdocflags : Rustflags ,
1370
1376
}
1371
1377
1372
1378
impl Cargo {
@@ -1400,6 +1406,7 @@ impl Cargo {
1400
1406
impl From < Cargo > for Command {
1401
1407
fn from ( mut cargo : Cargo ) -> Command {
1402
1408
cargo. command . env ( "RUSTFLAGS" , & cargo. rustflags . 0 ) ;
1409
+ cargo. command . env ( "RUSTDOCFLAGS" , & cargo. rustdocflags . 0 ) ;
1403
1410
cargo. command
1404
1411
}
1405
1412
}
0 commit comments