Skip to content

Commit a42131d

Browse files
Unknown -> Unsupported compression algorithm
Both zstd and zlib are *known* compression algorithms, they just may not be supported by the backend. We shouldn't mislead users into e.g. thinking they made a typo.
1 parent 7eadf83 commit a42131d

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

compiler/rustc_codegen_llvm/messages.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ codegen_llvm_symbol_already_defined =
5858
codegen_llvm_target_machine = could not create LLVM TargetMachine for triple: {$triple}
5959
codegen_llvm_target_machine_with_llvm_err = could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err}
6060
61-
codegen_llvm_unknown_debuginfo_compression = unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo
61+
codegen_llvm_unsupported_debuginfo_compression = unsupported debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo
6262
6363
codegen_llvm_write_bytecode = failed to write bytecode to {$path}: {$err}
6464

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::back::profiling::{
3535
};
3636
use crate::common::AsCCharPtr;
3737
use crate::errors::{
38-
CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, UnknownCompression,
38+
CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, UnsupportedCompression,
3939
WithLlvmError, WriteBytecode,
4040
};
4141
use crate::llvm::diagnostic::OptimizationDiagnosticKind::*;
@@ -256,15 +256,15 @@ pub(crate) fn target_machine_factory(
256256
if llvm::LLVMRustLLVMHasZlibCompression() {
257257
llvm::CompressionKind::Zlib
258258
} else {
259-
sess.dcx().emit_warn(UnknownCompression { algorithm: "zlib" });
259+
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zlib" });
260260
llvm::CompressionKind::None
261261
}
262262
}
263263
config::DebugInfoCompression::Zstd => {
264264
if llvm::LLVMRustLLVMHasZstdCompression() {
265265
llvm::CompressionKind::Zstd
266266
} else {
267-
sess.dcx().emit_warn(UnknownCompression { algorithm: "zstd" });
267+
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zstd" });
268268
llvm::CompressionKind::None
269269
}
270270
}

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ pub(crate) struct CopyBitcode {
160160
}
161161

162162
#[derive(Diagnostic)]
163-
#[diag(codegen_llvm_unknown_debuginfo_compression)]
164-
pub(crate) struct UnknownCompression {
163+
#[diag(codegen_llvm_unsupported_debuginfo_compression)]
164+
pub(crate) struct UnsupportedCompression {
165165
pub algorithm: &'static str,
166166
}
167167

tests/run-make/compressed-debuginfo/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn check_compression(compression: &str, to_find: &str) {
2323
} else {
2424
assert_contains(
2525
stderr,
26-
format!("unknown debuginfo compression algorithm {compression}"),
26+
format!("unsupported debuginfo compression algorithm {compression}"),
2727
);
2828
}
2929
});

0 commit comments

Comments
 (0)