about summary refs log tree commit diff
path: root/compiler/rustc_session/src/errors.rs
diff options
context:
space:
mode:
authorWesley Wiser <wwiser@gmail.com>2025-02-08 13:11:49 -0600
committerWesley Wiser <wwiser@gmail.com>2025-02-09 10:05:13 -0600
commiteea8ce5be4ca75e67d3b88d55f718e315c3d9d8b (patch)
treeec948b08b5d981f31c5f9de4ef26d31d65510e7b /compiler/rustc_session/src/errors.rs
parent8ad2c9724d983cfb116baab0bb800edd17f31644 (diff)
downloadrust-eea8ce5be4ca75e67d3b88d55f718e315c3d9d8b.tar.gz
rust-eea8ce5be4ca75e67d3b88d55f718e315c3d9d8b.zip
Emit an error if `-Zdwarf-version=1` is requested
DWARF 1 is very different than DWARF 2+ (see the commentary in
https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#index-gdwarf)
and LLVM does not really seem to support DWARF 1 as Clang does not offer
a `-gdwarf-1` flag and `llc` will just generate DWARF 2 with the version
set to 1: https://godbolt.org/z/s85d87n3a.

Since this isn't actually supported (and it's not clear it would be
useful anyway), report that DWARF 1 is not supported if it is requested.

Also add a help message to the error saying which versions are supported.
Diffstat (limited to 'compiler/rustc_session/src/errors.rs')
-rw-r--r--compiler/rustc_session/src/errors.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs
index 6c26a781487..75c3b2c7a85 100644
--- a/compiler/rustc_session/src/errors.rs
+++ b/compiler/rustc_session/src/errors.rs
@@ -161,6 +161,7 @@ pub(crate) struct UnstableVirtualFunctionElimination;
 
 #[derive(Diagnostic)]
 #[diag(session_unsupported_dwarf_version)]
+#[help(session_unsupported_dwarf_version_help)]
 pub(crate) struct UnsupportedDwarfVersion {
     pub(crate) dwarf_version: u32,
 }