diff options
Diffstat (limited to 'compiler/rustc_feature/src/tests.rs')
| -rw-r--r-- | compiler/rustc_feature/src/tests.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_feature/src/tests.rs b/compiler/rustc_feature/src/tests.rs index 50433e44b13..cc0e1f31209 100644 --- a/compiler/rustc_feature/src/tests.rs +++ b/compiler/rustc_feature/src/tests.rs @@ -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"))); } |
