make is_nightly_build a method on UnstableFeatures
This commit is contained in:
parent
6d09d8d7d9
commit
ba838dc4e9
@ -1583,10 +1583,7 @@ pub mod nightly_options {
|
||||
}
|
||||
|
||||
pub fn is_nightly_build() -> bool {
|
||||
match get_unstable_features_setting() {
|
||||
UnstableFeatures::Allow | UnstableFeatures::Cheat => true,
|
||||
_ => false,
|
||||
}
|
||||
UnstableFeatures::from_environment().is_nightly_build()
|
||||
}
|
||||
|
||||
pub fn check_nightly_options(matches: &getopts::Matches, flags: &[RustcOptGroup]) {
|
||||
|
@ -1312,6 +1312,13 @@ impl UnstableFeatures {
|
||||
(false, _, _) => UnstableFeatures::Allow
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_nightly_build(&self) -> bool {
|
||||
match *self {
|
||||
UnstableFeatures::Allow | UnstableFeatures::Cheat => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate,
|
||||
|
Loading…
x
Reference in New Issue
Block a user