about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2024-11-14 15:48:21 -0600
committerTrevor Gross <tmgross@umich.edu>2024-11-14 16:09:45 -0600
commitb77dbbd4fd2ed4083635f74612aa25b4be80fc43 (patch)
treea67a0606a91532827b8b93a5abcba280fc1b290e
parentc82e0dff84f922274c3060f09b5ae78d5dbf5c49 (diff)
downloadrust-b77dbbd4fd2ed4083635f74612aa25b4be80fc43.tar.gz
rust-b77dbbd4fd2ed4083635f74612aa25b4be80fc43.zip
Pass `f16` and `f128` by value in `const_assert!`
These types are currently passed by reference, which does not avoid the
backend crashes. Change these back to being passed by value, which makes
the types easier to detect for automatic inlining.
-rw-r--r--library/core/src/num/f128.rs5
-rw-r--r--library/core/src/num/f16.rs5
2 files changed, 4 insertions, 6 deletions
diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs
index c3862d99498..3fac1ef099f 100644
--- a/library/core/src/num/f128.rs
+++ b/library/core/src/num/f128.rs
@@ -1258,9 +1258,8 @@ impl f128 {
             min <= max,
             "min > max, or either was NaN",
             "min > max, or either was NaN. min = {min:?}, max = {max:?}",
-            // FIXME(f16_f128): Passed by-ref to avoid codegen crashes
-            min: &f128 = &min,
-            max: &f128 = &max,
+            min: f128,
+            max: f128,
         );
 
         if self < min {
diff --git a/library/core/src/num/f16.rs b/library/core/src/num/f16.rs
index ed35316cf8f..eaac19f22f7 100644
--- a/library/core/src/num/f16.rs
+++ b/library/core/src/num/f16.rs
@@ -1235,9 +1235,8 @@ impl f16 {
             min <= max,
             "min > max, or either was NaN",
             "min > max, or either was NaN. min = {min:?}, max = {max:?}",
-            // FIXME(f16_f128): Passed by-ref to avoid codegen crashes
-            min: &f16 = &min,
-            max: &f16 = &max,
+            min: f16,
+            max: f16,
         );
 
         if self < min {