Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Ignore unused variables when compiler-builtins is set #525

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/compiler-builtins-smoke-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ test = false
bench = false

[features]
default = ["arch", "unstable-float"]
default = ["arch", "compiler-builtins", "unstable-float"]

# Copied from `libm`'s root `Cargo.toml`'
unstable-float = []
arch = []
compiler-builtins = []
unstable-float = []

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
"cfg(arch_enabled)",
"cfg(assert_no_panic)",
"cfg(intrinsics_enabled)",
'cfg(feature, values("compiler-builtins"))',
'cfg(feature, values("force-soft-floats"))',
'cfg(feature, values("unstable"))',
'cfg(feature, values("unstable-intrinsics"))',
Expand Down
6 changes: 4 additions & 2 deletions src/math/support/hex_float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ impl<F: Float> fmt::LowerHex for Hexf<F> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
cfg_if! {
if #[cfg(feature = "compiler-builtins")] {
unreachable!()
let _ = f;
unimplemented!()
} else {
fmt_any_hex(&self.0, f)
}
Expand All @@ -272,7 +273,8 @@ impl fmt::LowerHex for Hexf<i32> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
cfg_if! {
if #[cfg(feature = "compiler-builtins")] {
unreachable!()
let _ = f;
unimplemented!()
} else {
fmt::LowerHex::fmt(&self.0, f)
}
Expand Down