Add RUSTC_BOOTSTRAP=-1 to make rustc pretend as stable compiler
This commit is contained in:
@@ -18,6 +18,16 @@ fn rustc_bootstrap_parsing() {
|
||||
assert!(!is_bootstrap("x,y,z", Some("a")));
|
||||
assert!(!is_bootstrap("x,y,z", None));
|
||||
|
||||
// this is technically a breaking change, but there are no stability guarantees for RUSTC_BOOTSTRAP
|
||||
// `RUSTC_BOOTSTRAP=0` is not recognized.
|
||||
assert!(!is_bootstrap("0", None));
|
||||
|
||||
// `RUSTC_BOOTSTRAP=-1` is force-stable, no unstable features allowed.
|
||||
let is_force_stable = |krate| {
|
||||
std::env::set_var("RUSTC_BOOTSTRAP", "-1");
|
||||
matches!(UnstableFeatures::from_environment(krate), UnstableFeatures::Disallow)
|
||||
};
|
||||
assert!(is_force_stable(None));
|
||||
// Does not support specifying any crate.
|
||||
assert!(is_force_stable(Some("x")));
|
||||
assert!(is_force_stable(Some("x,y,z")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user