Skip to content

Commit

Permalink
Emit warning to user when attempting to use optimize for size on non-…
Browse files Browse the repository at this point in the history
…nightly builds.
  • Loading branch information
brandonedens committed Apr 30, 2016
1 parent 49d2825 commit 16eaecb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 `{}`)",
Expand Down

0 comments on commit 16eaecb

Please sign in to comment.