Skip to content

Commit 2e1c6d5

Browse files
authored
Rollup merge of #144010 - xdoardo:bootstrap-warning-optimize-false, r=clubby789
Boostrap: add warning on `optimize = false` I recently came across a bug that can be traced back to the use of `optimize = false` in `bootstrap.toml` in combination with other settings. Following [this](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/Missing.20box-related.20symbols.20with.20panic.20.3D.20'abort'/with/528992909) conversation, this PR adds a warning from `bootstrap` when `optimize = false` is used. I notice that in the same file I edited there are two different styles for warnings (`WARN`, `Warning`). I used `WARNING` because, by happenstance, when testing I got a `WARNING` that I didn't set a change id: let me know if I can unify the styles in the file I edited.
2 parents fccc5c0 + 0e423f4 commit 2e1c6d5

File tree

1 file changed

+8
-0
lines changed
  • src/bootstrap/src/core/config/toml

1 file changed

+8
-0
lines changed

src/bootstrap/src/core/config/toml/rust.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ impl Config {
531531
lld_enabled = lld_enabled_toml;
532532
std_features = std_features_toml;
533533

534+
if optimize_toml.as_ref().is_some_and(|v| matches!(v, RustOptimize::Bool(false))) {
535+
eprintln!(
536+
"WARNING: setting `optimize` to `false` is known to cause errors and \
537+
should be considered unsupported. Refer to `bootstrap.example.toml` \
538+
for more details."
539+
);
540+
}
541+
534542
optimize = optimize_toml;
535543
self.rust_new_symbol_mangling = new_symbol_mangling;
536544
set(&mut self.rust_optimize_tests, optimize_tests);

0 commit comments

Comments
 (0)