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.
This commit is contained in:
Matthias Krüger 2025-07-18 04:27:54 +02:00 committed by GitHub
commit 3023a287fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -531,6 +531,14 @@ impl Config {
lld_enabled = lld_enabled_toml;
std_features = std_features_toml;
if optimize_toml.as_ref().is_some_and(|v| matches!(v, RustOptimize::Bool(false))) {
eprintln!(
"WARNING: setting `optimize` to `false` is known to cause errors and \
should be considered unsupported. Refer to `bootstrap.example.toml` \
for more details."
);
}
optimize = optimize_toml;
self.rust_new_symbol_mangling = new_symbol_mangling;
set(&mut self.rust_optimize_tests, optimize_tests);