Skip to content

Commit 33ee6e0

Browse files
committed
Change -Copt-level=3 to -Copt-level=2
1 parent e491cae commit 33ee6e0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

compiler/rustc_session/src/config.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ fn parse_opt_level(
20962096
if let Some("opt-level") = s.split('=').next() { Some(i) } else { None }
20972097
})
20982098
.max();
2099-
if max_o > max_c {
2099+
let level = if max_o > max_c {
21002100
OptLevel::Default
21012101
} else {
21022102
match cg.opt_level.as_ref() {
@@ -2113,6 +2113,11 @@ fn parse_opt_level(
21132113
));
21142114
}
21152115
}
2116+
};
2117+
if std::env::var("BOOTSTRAPPIN").is_err() && level == OptLevel::Aggressive {
2118+
OptLevel::Default
2119+
} else {
2120+
level
21162121
}
21172122
}
21182123

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ impl Cargo {
110110
cmd_kind: Kind,
111111
) -> Cargo {
112112
let mut cargo = builder.cargo(compiler, mode, source_type, target, cmd_kind);
113+
cargo.env("BOOTSTRAPPIN", "1");
113114

114115
match cmd_kind {
115116
// No need to configure the target linker for these command types,

0 commit comments

Comments
 (0)