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

Commit 33fb12b

Browse files
committed
Ignore unused variables when compiler-builtins is set
1 parent c0b4628 commit 33fb12b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

libm/crates/compiler-builtins-smoke-test/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ test = false
1111
bench = false
1212

1313
[features]
14-
default = ["arch", "unstable-float"]
14+
default = ["arch", "compiler-builtins", "unstable-float"]
1515

1616
# Copied from `libm`'s root `Cargo.toml`'
17-
unstable-float = []
1817
arch = []
18+
compiler-builtins = []
19+
unstable-float = []
1920

2021
[lints.rust]
2122
unexpected_cfgs = { level = "warn", check-cfg = [
2223
"cfg(arch_enabled)",
2324
"cfg(assert_no_panic)",
2425
"cfg(intrinsics_enabled)",
25-
'cfg(feature, values("compiler-builtins"))',
2626
'cfg(feature, values("force-soft-floats"))',
2727
'cfg(feature, values("unstable"))',
2828
'cfg(feature, values("unstable-intrinsics"))',

libm/src/math/support/hex_float.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ impl<F: Float> fmt::LowerHex for Hexf<F> {
248248
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
249249
cfg_if! {
250250
if #[cfg(feature = "compiler-builtins")] {
251-
unreachable!()
251+
let _ = f;
252+
unimplemented!()
252253
} else {
253254
fmt_any_hex(&self.0, f)
254255
}
@@ -272,7 +273,8 @@ impl fmt::LowerHex for Hexf<i32> {
272273
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
273274
cfg_if! {
274275
if #[cfg(feature = "compiler-builtins")] {
275-
unreachable!()
276+
let _ = f;
277+
unimplemented!()
276278
} else {
277279
fmt::LowerHex::fmt(&self.0, f)
278280
}

0 commit comments

Comments
 (0)