mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
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:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user