Skip to content

Commit 946ab00

Browse files
committed
Auto merge of #5613 - oli-obk:master, r=matklad
Allow rustc bootstrap to use unstable features even though it's using a beta-cargo This is the sane alternative to rust-lang/rust#51322 (comment) cc @kennytm
2 parents d33c65c + 1bdb89d commit 946ab00

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(override_channel) = env::var("__CARGO_TEST_CHANNEL_OVERRIDE_DO_NOT_USE_THIS") {
358+
return override_channel;
359+
}
360+
if let Ok(staging) = env::var("RUSTC_BOOTSTRAP") {
361+
if staging == "1" {
362+
return "dev".to_string();
363+
}
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)