Skip to content

Commit 16eaecb

Browse files
committed
Emit warning to user when attempting to use optimize for size on non-nightly builds.
1 parent 49d2825 commit 16eaecb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc/session/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11361136
(Some("3"), _) => OptLevel::Aggressive,
11371137
(Some("s"), true) => OptLevel::Size,
11381138
(Some("z"), true) => OptLevel::SizeMin,
1139+
(Some("s"), false) | (Some("z"), false) => {
1140+
early_error(error_format, &format!("the optimizations s or z are only \
1141+
accepted on the nightly compiler"));
1142+
},
11391143
(Some(arg), _) => {
11401144
early_error(error_format, &format!("optimization level needs to be \
11411145
between 0-3 (instead was `{}`)",

0 commit comments

Comments
 (0)