diff options
| author | Brandon Edens <brandonedens@gmail.com> | 2016-04-29 22:45:24 -0700 |
|---|---|---|
| committer | Brandon Edens <brandonedens@gmail.com> | 2016-04-29 22:45:24 -0700 |
| commit | 16eaecbe43bc135b5b69cd114c25deb14a09c9e4 (patch) | |
| tree | 23b90fd4e4dbced631aa715f0cb6647048d37173 | |
| parent | 49d28258a72d70cf7c752caa6b394761a02a5700 (diff) | |
| download | rust-16eaecbe43bc135b5b69cd114c25deb14a09c9e4.tar.gz rust-16eaecbe43bc135b5b69cd114c25deb14a09c9e4.zip | |
Emit warning to user when attempting to use optimize for size on non-nightly builds.
| -rw-r--r-- | src/librustc/session/config.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index ab753733450..b8dd750d3f1 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -1136,6 +1136,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options { (Some("3"), _) => OptLevel::Aggressive, (Some("s"), true) => OptLevel::Size, (Some("z"), true) => OptLevel::SizeMin, + (Some("s"), false) | (Some("z"), false) => { + early_error(error_format, &format!("the optimizations s or z are only \ + accepted on the nightly compiler")); + }, (Some(arg), _) => { early_error(error_format, &format!("optimization level needs to be \ between 0-3 (instead was `{}`)", |
