Skip to content

Commit b5d5e8c

Browse files
Rollup merge of rust-lang#150630 - Mark-Simulacrum:rephrase-compression-warn, r=JonathanBrouwer
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. cc rust-lang#120953
2 parents fbaafdc + 6458ca5 commit b5d5e8c

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use crate::builder::gpu_offload::scalar_width;
3636
use crate::common::AsCCharPtr;
3737
use crate::errors::{
3838
CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, ParseTargetMachineConfig,
39-
UnknownCompression, WithLlvmError, WriteBytecode,
39+
UnsupportedCompression, WithLlvmError, WriteBytecode,
4040
};
4141
use crate::llvm::diagnostic::OptimizationDiagnosticKind::*;
4242
use crate::llvm::{self, DiagnosticInfo};
@@ -248,15 +248,15 @@ pub(crate) fn target_machine_factory(
248248
if llvm::LLVMRustLLVMHasZlibCompression() {
249249
llvm::CompressionKind::Zlib
250250
} else {
251-
sess.dcx().emit_warn(UnknownCompression { algorithm: "zlib" });
251+
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zlib" });
252252
llvm::CompressionKind::None
253253
}
254254
}
255255
config::DebugInfoCompression::Zstd => {
256256
if llvm::LLVMRustLLVMHasZstdCompression() {
257257
llvm::CompressionKind::Zstd
258258
} else {
259-
sess.dcx().emit_warn(UnknownCompression { algorithm: "zstd" });
259+
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zstd" });
260260
llvm::CompressionKind::None
261261
}
262262
}

compiler/rustc_codegen_llvm/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ pub(crate) struct CopyBitcode {
182182

183183
#[derive(Diagnostic)]
184184
#[diag(
185-
"unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo"
185+
"unsupported debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo"
186186
)]
187-
pub(crate) struct UnknownCompression {
187+
pub(crate) struct UnsupportedCompression {
188188
pub algorithm: &'static str,
189189
}
190190

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)