make is_nightly_build a method on UnstableFeatures

This commit is contained in:
Tim Neumann 2016-09-24 19:19:17 +02:00
parent 6d09d8d7d9
commit ba838dc4e9
2 changed files with 8 additions and 4 deletions

View File

@ -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]) {

View File

@ -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,