Skip to content

Commit

Permalink
Rollup merge of #112109 - Alexendoo:unsupported-split-debuginfo, r=b-…
Browse files Browse the repository at this point in the history
…naber

Don't print unsupported split-debuginfo modes with `-Zunstable-options`

Currently unsupported `split-debuginfo` options are enabled by `-Zunstable-options`, for projects that have `-Zunstable-options` for other reasons this can be [an unexpected interaction](rust-lang/rust-clippy#10516 (comment))

This PR makes it so that `--print split-debuginfo -Zunstable-options` doesn't print unsupported modes, so that a cargo config of e.g.

```toml
[profile.dev]
split-debuginfo = "unpacked"
```

Would not cause an unsupported mode to be enabled on `x86_64-pc-windows-msvc`
  • Loading branch information
matthiaskrgr committed Jun 14, 2023
2 parents c451f7b + fda3c9f commit 38ed4e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,7 @@ fn print_crate_info(
use rustc_target::spec::SplitDebuginfo::{Off, Packed, Unpacked};

for split in &[Off, Packed, Unpacked] {
let stable = sess.target.options.supported_split_debuginfo.contains(split);
let unstable_ok = sess.unstable_options();
if stable || unstable_ok {
if sess.target.options.supported_split_debuginfo.contains(split) {
safe_println!("{split}");
}
}
Expand Down

0 comments on commit 38ed4e5

Please sign in to comment.