about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2025-01-25 04:18:44 +0000
committerTrevor Gross <tmgross@umich.edu>2025-01-25 04:18:44 +0000
commit4a98907b8a9f7cabf758fa7241466a62735fba88 (patch)
treec2a6e279744d5d8559ae6003f7e95c49e43d89d9
parent9c6548e448eea6a1f955ded8940a9d10d3f21414 (diff)
downloadrust-4a98907b8a9f7cabf758fa7241466a62735fba88.tar.gz
rust-4a98907b8a9f7cabf758fa7241466a62735fba88.zip
Remove remnants of the `checked` feature
The Cargo feature `checked` was added in 410b0633a6b9 ("Overhaul tests")
and later removed in e4ac1399062c ("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.
-rw-r--r--library/compiler-builtins/libm/build.rs19
-rw-r--r--library/compiler-builtins/libm/crates/compiler-builtins-smoke-test/Cargo.toml1
-rw-r--r--library/compiler-builtins/libm/src/math/rem_pio2_large.rs5
3 files changed, 10 insertions, 15 deletions
diff --git a/library/compiler-builtins/libm/build.rs b/library/compiler-builtins/libm/build.rs
index ca4a639a12a..caf5a108a26 100644
--- a/library/compiler-builtins/libm/build.rs
+++ b/library/compiler-builtins/libm/build.rs
@@ -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);
diff --git a/library/compiler-builtins/libm/crates/compiler-builtins-smoke-test/Cargo.toml b/library/compiler-builtins/libm/crates/compiler-builtins-smoke-test/Cargo.toml
index d578b0dcd0b..24b33645e97 100644
--- a/library/compiler-builtins/libm/crates/compiler-builtins-smoke-test/Cargo.toml
+++ b/library/compiler-builtins/libm/crates/compiler-builtins-smoke-test/Cargo.toml
@@ -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"))',
diff --git a/library/compiler-builtins/libm/src/math/rem_pio2_large.rs b/library/compiler-builtins/libm/src/math/rem_pio2_large.rs
index ec8397f4b6f..6d679bbe98c 100644
--- a/library/compiler-builtins/libm/src/math/rem_pio2_large.rs
+++ b/library/compiler-builtins/libm/src/math/rem_pio2_large.rs
@@ -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();