Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make is_nightly_build a method on UnstableFeatures
  • Loading branch information
TimNN committed Sep 26, 2016
1 parent 6d09d8d commit ba838dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/librustc/session/config.rs
Expand Up @@ -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]) {
Expand Down
7 changes: 7 additions & 0 deletions src/libsyntax/feature_gate.rs
Expand Up @@ -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,
Expand Down

0 comments on commit ba838dc

Please sign in to comment.