Skip to content

Commit ba838dc

Browse files
committed
make is_nightly_build a method on UnstableFeatures
1 parent 6d09d8d commit ba838dc

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/librustc/session/config.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,10 +1583,7 @@ pub mod nightly_options {
15831583
}
15841584

15851585
pub fn is_nightly_build() -> bool {
1586-
match get_unstable_features_setting() {
1587-
UnstableFeatures::Allow | UnstableFeatures::Cheat => true,
1588-
_ => false,
1589-
}
1586+
UnstableFeatures::from_environment().is_nightly_build()
15901587
}
15911588

15921589
pub fn check_nightly_options(matches: &getopts::Matches, flags: &[RustcOptGroup]) {

src/libsyntax/feature_gate.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,13 @@ impl UnstableFeatures {
13121312
(false, _, _) => UnstableFeatures::Allow
13131313
}
13141314
}
1315+
1316+
pub fn is_nightly_build(&self) -> bool {
1317+
match *self {
1318+
UnstableFeatures::Allow | UnstableFeatures::Cheat => true,
1319+
_ => false,
1320+
}
1321+
}
13151322
}
13161323

13171324
fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate,

0 commit comments

Comments
 (0)