Skip to content

Commit 2b09d7c

Browse files
committed
stabilize opt-level={s,z}
closes #35784
1 parent 7f3444e commit 2b09d7c

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

src/librustc/session/config.rs

+9-21
Original file line numberDiff line numberDiff line change
@@ -1972,27 +1972,15 @@ pub fn build_session_options_and_crate_config(
19721972
}
19731973
OptLevel::Default
19741974
} else {
1975-
match (
1976-
cg.opt_level.as_ref().map(String::as_ref),
1977-
nightly_options::is_nightly_build(),
1978-
) {
1979-
(None, _) => OptLevel::No,
1980-
(Some("0"), _) => OptLevel::No,
1981-
(Some("1"), _) => OptLevel::Less,
1982-
(Some("2"), _) => OptLevel::Default,
1983-
(Some("3"), _) => OptLevel::Aggressive,
1984-
(Some("s"), true) => OptLevel::Size,
1985-
(Some("z"), true) => OptLevel::SizeMin,
1986-
(Some("s"), false) | (Some("z"), false) => {
1987-
early_error(
1988-
error_format,
1989-
&format!(
1990-
"the optimizations s or z are only \
1991-
accepted on the nightly compiler"
1992-
),
1993-
);
1994-
}
1995-
(Some(arg), _) => {
1975+
match cg.opt_level.as_ref().map(String::as_ref) {
1976+
None => OptLevel::No,
1977+
Some("0") => OptLevel::No,
1978+
Some("1") => OptLevel::Less,
1979+
Some("2") => OptLevel::Default,
1980+
Some("3") => OptLevel::Aggressive,
1981+
Some("s") => OptLevel::Size,
1982+
Some("z") => OptLevel::SizeMin,
1983+
Some(arg) => {
19961984
early_error(
19971985
error_format,
19981986
&format!(

0 commit comments

Comments
 (0)