Skip to content

Commit 3c38bc1

Browse files
committed
---
yaml --- r: 277522 b: refs/heads/try c: 49d2825 h: refs/heads/master
1 parent bc3f3de commit 3c38bc1

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 8a8493a56593c6082b302d00f55232953dc7db47
4+
refs/heads/try: 49d28258a72d70cf7c752caa6b394761a02a5700
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/session/config.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,17 +1127,18 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11271127
}
11281128
OptLevel::Default
11291129
} else {
1130-
match cg.opt_level.as_ref().map(String::as_ref) {
1131-
None => OptLevel::No,
1132-
Some("0") => OptLevel::No,
1133-
Some("1") => OptLevel::Less,
1134-
Some("2") => OptLevel::Default,
1135-
Some("3") => OptLevel::Aggressive,
1136-
Some("s") => OptLevel::Size,
1137-
Some("z") => OptLevel::SizeMin,
1138-
Some(arg) => {
1130+
match (cg.opt_level.as_ref().map(String::as_ref),
1131+
nightly_options::is_nightly_build()) {
1132+
(None, _) => OptLevel::No,
1133+
(Some("0"), _) => OptLevel::No,
1134+
(Some("1"), _) => OptLevel::Less,
1135+
(Some("2"), _) => OptLevel::Default,
1136+
(Some("3"), _) => OptLevel::Aggressive,
1137+
(Some("s"), true) => OptLevel::Size,
1138+
(Some("z"), true) => OptLevel::SizeMin,
1139+
(Some(arg), _) => {
11391140
early_error(error_format, &format!("optimization level needs to be \
1140-
between 0-3, s, or z (instead was `{}`)",
1141+
between 0-3 (instead was `{}`)",
11411142
arg));
11421143
}
11431144
}
@@ -1308,7 +1309,7 @@ pub mod nightly_options {
13081309
is_nightly_build() && matches.opt_strs("Z").iter().any(|x| *x == "unstable-options")
13091310
}
13101311

1311-
fn is_nightly_build() -> bool {
1312+
pub fn is_nightly_build() -> bool {
13121313
match get_unstable_features_setting() {
13131314
UnstableFeatures::Allow | UnstableFeatures::Cheat => true,
13141315
_ => false,

0 commit comments

Comments
 (0)