about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-06-14 18:10:29 +0200
committerGitHub <noreply@github.com>2023-06-14 18:10:29 +0200
commit38ed4e5a5cf1820ed76bcba235b70dcb29f8118d (patch)
tree2a54646d3b5e69cd4f331ec46ddbdb37123a5f30 /compiler/rustc_driver_impl/src
parentc451f7bedb8ec096c5e66da511bb3be79a0c5c46 (diff)
parentfda3c9f4a8bd8daf9f5b3c7e4f45079f347a0ba5 (diff)
downloadrust-38ed4e5a5cf1820ed76bcba235b70dcb29f8118d.tar.gz
rust-38ed4e5a5cf1820ed76bcba235b70dcb29f8118d.zip
Rollup merge of #112109 - Alexendoo:unsupported-split-debuginfo, r=b-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](https://github.com/rust-lang/rust-clippy/pull/10516#issuecomment-1562604764)

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`
Diffstat (limited to 'compiler/rustc_driver_impl/src')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index f8dda23ef9c..2f1c7819727 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -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}");
                     }
                 }