mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
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.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
use crate::common::AsCCharPtr;
|
||||
use crate::errors::{
|
||||
CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, ParseTargetMachineConfig,
|
||||
UnknownCompression, WithLlvmError, WriteBytecode,
|
||||
UnsupportedCompression, WithLlvmError, WriteBytecode,
|
||||
};
|
||||
use crate::llvm::diagnostic::OptimizationDiagnosticKind::*;
|
||||
use crate::llvm::{self, DiagnosticInfo};
|
||||
@@ -248,7 +248,7 @@ pub(crate) fn target_machine_factory(
|
||||
if llvm::LLVMRustLLVMHasZlibCompression() {
|
||||
llvm::CompressionKind::Zlib
|
||||
} else {
|
||||
sess.dcx().emit_warn(UnknownCompression { algorithm: "zlib" });
|
||||
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zlib" });
|
||||
llvm::CompressionKind::None
|
||||
}
|
||||
}
|
||||
@@ -256,7 +256,7 @@ pub(crate) fn target_machine_factory(
|
||||
if llvm::LLVMRustLLVMHasZstdCompression() {
|
||||
llvm::CompressionKind::Zstd
|
||||
} else {
|
||||
sess.dcx().emit_warn(UnknownCompression { algorithm: "zstd" });
|
||||
sess.dcx().emit_warn(UnsupportedCompression { algorithm: "zstd" });
|
||||
llvm::CompressionKind::None
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,9 +182,9 @@ pub(crate) struct CopyBitcode {
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(
|
||||
"unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo"
|
||||
"unsupported debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo"
|
||||
)]
|
||||
pub(crate) struct UnknownCompression {
|
||||
pub(crate) struct UnsupportedCompression {
|
||||
pub algorithm: &'static str,
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ fn check_compression(compression: &str, to_find: &str) {
|
||||
} else {
|
||||
assert_contains(
|
||||
stderr,
|
||||
format!("unknown debuginfo compression algorithm {compression}"),
|
||||
format!("unsupported debuginfo compression algorithm {compression}"),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user