Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cdb5ff5

Browse files
committedNov 14, 2024
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.
1 parent d2983ff commit cdb5ff5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed
 

‎core/src/num/f128.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1258,9 +1258,8 @@ impl f128 {
12581258
min <= max,
12591259
"min > max, or either was NaN",
12601260
"min > max, or either was NaN. min = {min:?}, max = {max:?}",
1261-
// FIXME(f16_f128): Passed by-ref to avoid codegen crashes
1262-
min: &f128 = &min,
1263-
max: &f128 = &max,
1261+
min: f128,
1262+
max: f128,
12641263
);
12651264

12661265
if self < min {

‎core/src/num/f16.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,8 @@ impl f16 {
12351235
min <= max,
12361236
"min > max, or either was NaN",
12371237
"min > max, or either was NaN. min = {min:?}, max = {max:?}",
1238-
// FIXME(f16_f128): Passed by-ref to avoid codegen crashes
1239-
min: &f16 = &min,
1240-
max: &f16 = &max,
1238+
min: f16,
1239+
max: f16,
12411240
);
12421241

12431242
if self < min {

0 commit comments

Comments
 (0)
Please sign in to comment.