about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-08 03:32:51 +0000
committerbors <bors@rust-lang.org>2024-11-08 03:32:51 +0000
commit78bb5ee79e0261e8e47476b631da02acc1cb03ef (patch)
tree0a4c7d02d444cd7dbf030fd01c63257f0748cbb4 /library/std/src
parent5b20c459997590eda4d324b53cdc55439a56265d (diff)
parent97dbab9124ff8ecaf4ced5720996e67e51fc62ea (diff)
downloadrust-78bb5ee79e0261e8e47476b631da02acc1cb03ef.tar.gz
rust-78bb5ee79e0261e8e47476b631da02acc1cb03ef.zip
Auto merge of #132756 - workingjubilee:rollup-bed2akn, r=workingjubilee
Rollup of 10 pull requests

Successful merges:

 - #130586 (Set "symbol name" in raw-dylib import libraries to the decorated name)
 - #131913 (Add `{ignore,needs}-{rustc,std}-debug-assertions` directive support)
 - #132095 (Fix #131977 parens mangled in shared mut static lint suggestion)
 - #132131 ([StableMIR] API to retrieve definitions from crates)
 - #132639 (core: move intrinsics.rs into intrinsics folder)
 - #132696 (Compile `test_num_f128` conditionally on `reliable_f128_math` config)
 - #132737 (bootstrap: Print better message if lock pid isn't available)
 - #132739 (Fix `librustdoc/scrape_examples.rs` formatting)
 - #132740 (Update test for LLVM 20's new vector splat syntax)
 - #132741 (Update mips64 data layout to match LLVM 20 change)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/f128/tests.rs22
1 files changed, 20 insertions, 2 deletions
diff --git a/library/std/src/f128/tests.rs b/library/std/src/f128/tests.rs
index 7051c051bf7..cbcf9f96239 100644
--- a/library/std/src/f128/tests.rs
+++ b/library/std/src/f128/tests.rs
@@ -2,7 +2,10 @@
 #![cfg(reliable_f128)]
 
 use crate::f128::consts;
-use crate::num::{FpCategory as Fp, *};
+use crate::num::FpCategory as Fp;
+#[cfg(reliable_f128_math)]
+use crate::ops::Rem;
+use crate::ops::{Add, Div, Mul, Sub};
 
 // Note these tolerances make sense around zero, but not for more extreme exponents.
 
@@ -53,7 +56,22 @@ macro_rules! assert_f128_biteq {
 
 #[test]
 fn test_num_f128() {
-    test_num(10f128, 2f128);
+    // FIXME(f16_f128): replace with a `test_num` call once the required `fmodl`/`fmodf128`
+    // function is available on all platforms.
+    let ten = 10f128;
+    let two = 2f128;
+    assert_eq!(ten.add(two), ten + two);
+    assert_eq!(ten.sub(two), ten - two);
+    assert_eq!(ten.mul(two), ten * two);
+    assert_eq!(ten.div(two), ten / two);
+}
+
+#[test]
+#[cfg(reliable_f128_math)]
+fn test_num_f128_rem() {
+    let ten = 10f128;
+    let two = 2f128;
+    assert_eq!(ten.rem(two), ten % two);
 }
 
 #[test]