Skip to content

Commit

Permalink
Pass f16 and f128 by value in const_assert!
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tgross35 committed Nov 14, 2024
1 parent d2983ff commit cdb5ff5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions core/src/num/f128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions core/src/num/f16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cdb5ff5

Please sign in to comment.