Skip to content

Commit ac3cac4

Browse files
committed
Allow rustc bootstrap to use unstable features even though it's using a beta-cargo
1 parent d33c65c commit ac3cac4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/cargo/core/features.rs

+12-6
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,18 @@ impl CliUnstable {
354354
}
355355

356356
fn channel() -> String {
357-
env::var("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS").unwrap_or_else(|_| {
358-
::version()
359-
.cfg_info
360-
.map(|c| c.release_channel)
361-
.unwrap_or_else(|| String::from("dev"))
362-
})
357+
if let Ok(staging) = env::var("RUSTC_BOOTSTRAP") {
358+
if staging == "1" {
359+
return "dev".to_string();
360+
}
361+
}
362+
if let Ok(override_channel) = env::var("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS") {
363+
return override_channel;
364+
}
365+
::version()
366+
.cfg_info
367+
.map(|c| c.release_channel)
368+
.unwrap_or_else(|| String::from("dev"))
363369
}
364370

365371
fn nightly_features_allowed() -> bool {

0 commit comments

Comments
 (0)