Repository navigation
Conversation
7aa7316 to
962357a
Compare
core/src/num/f{16,32,64,128}.rs (part 2)
This comment has been minimized.
This comment has been minimized.
962357a to
ce24dc5
Compare
| /// The stabilized version of this intrinsic is [`f16::min`]. | ||
| #[rustc_nounwind] | ||
| #[rustc_intrinsic] | ||
| #[rustc_const_unstable(feature = "f16", issue = "116909")] |
There was a problem hiding this comment.
Why are you adding this? Stability attributes on intrinsics are unusual as intrinsics are not meant to be stabilized.
There was a problem hiding this comment.
Now removed, see below.
| #[inline] | ||
| #[doc(alias = "nextUp")] | ||
| #[unstable(feature = "f128", issue = "116909")] | ||
| #[rustc_const_unstable(feature = "f128", issue = "116909")] |
There was a problem hiding this comment.
FWIW this makes the function unstable to use inside std from stable code. It should only be used if the body of the function needs const-unstable features. Why did you add this?
There was a problem hiding this comment.
Of the unstable functions I moved to the macro, currently one has rustc_const_unstable (is_finite), and some don't. I thought it would be more consistent for them all to have the attribute; I hadn't seen the rustc-dev-guide section that says it's "only needed in rare cases" "If a const fn makes use of unstable language features or intrinsics". As you say, rustc_const_unstable makes a function require the rustc_const_unstable attribute to use it within std: next_up calls is_nan, so adding the rustc_const_unstable to is_nan means that it also must be added to next_up.
I've removed the rustc_const_unstable attributes this PR added, so this is no longer an issue.
ce24dc5 to
ef3d13d
Compare
This is the sequel to #163410, moving the float classification methods to the macro. To make this easier to review, in the first commit I've included a copy-paste of the new parts of the macro in the same place as where the methods have been moved from, so the diff will show the changes. I've then removed these duplicates in the second commit, leaving the final state with no duplication.
r? @ChrisDenton