From b77dbbd4fd2ed4083635f74612aa25b4be80fc43 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 14 Nov 2024 15:48:21 -0600 Subject: [PATCH] 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. --- library/core/src/num/f128.rs | 5 ++--- library/core/src/num/f16.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/library/core/src/num/f128.rs b/library/core/src/num/f128.rs index c3862d994986a..3fac1ef099f35 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 ed35316cf8f9c..eaac19f22f751 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 {