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.
This commit is contained in:
Trevor Gross
2024-11-14 15:48:21 -06:00
parent c82e0dff84
commit b77dbbd4fd
2 changed files with 4 additions and 6 deletions
+2 -3
View File
@@ -1258,9 +1258,8 @@ pub const fn clamp(mut self, min: f128, max: f128) -> 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 {
+2 -3
View File
@@ -1235,9 +1235,8 @@ pub const fn clamp(mut self, min: f16, max: f16) -> 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 {