Skip to content

Commit

Permalink
Remove remnants of the checked feature
Browse files Browse the repository at this point in the history
The Cargo feature `checked` was added in d166a30 ("Overhaul tests")
and later removed in 5e0eca7 ("swap stable to be unstable, checked
is now debug_assertions"). However, there are a few remaining uses of
`feature = "checked"` that did not get removed. Clean these up here.
  • Loading branch information
tgross35 committed Jan 25, 2025
1 parent 46a3bce commit a2074e5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
19 changes: 7 additions & 12 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,13 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-check-cfg=cfg(assert_no_panic)");

println!("cargo:rustc-check-cfg=cfg(feature, values(\"checked\"))");

#[allow(unexpected_cfgs)]
if !cfg!(feature = "checked") {
let lvl = env::var("OPT_LEVEL").unwrap();
if lvl != "0" && !cfg!(debug_assertions) {
println!("cargo:rustc-cfg=assert_no_panic");
} else if env::var("ENSURE_NO_PANIC").is_ok() {
// Give us a defensive way of ensureing that no-panic is checked when we
// expect it to be.
panic!("`assert_no_panic `was not enabled");
}
let lvl = env::var("OPT_LEVEL").unwrap();
if lvl != "0" && !cfg!(debug_assertions) {
println!("cargo:rustc-cfg=assert_no_panic");
} else if env::var("ENSURE_NO_PANIC").is_ok() {
// Give us a defensive way of ensureing that no-panic is checked when we
// expect it to be.
panic!("`assert_no_panic `was not enabled");
}

configure::emit_libm_config(&cfg);
Expand Down
1 change: 0 additions & 1 deletion crates/compiler-builtins-smoke-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ unexpected_cfgs = { level = "warn", check-cfg = [
"cfg(arch_enabled)",
"cfg(assert_no_panic)",
"cfg(intrinsics_enabled)",
'cfg(feature, values("checked"))',
'cfg(feature, values("force-soft-floats"))',
'cfg(feature, values("unstable"))',
'cfg(feature, values("unstable-intrinsics"))',
Expand Down
5 changes: 3 additions & 2 deletions src/math/rem_pio2_large.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ pub(crate) fn rem_pio2_large(x: &[f64], y: &mut [f64], e0: i32, prec: usize) ->
let x1p24 = f64::from_bits(0x4170000000000000); // 0x1p24 === 2 ^ 24
let x1p_24 = f64::from_bits(0x3e70000000000000); // 0x1p_24 === 2 ^ (-24)

#[cfg(all(target_pointer_width = "64", feature = "checked"))]
assert!(e0 <= 16360);
if cfg!(target_pointer_width = "64") {
debug_assert!(e0 <= 16360);
}

let nx = x.len();

Expand Down

0 comments on commit a2074e5

Please sign in to comment.