Skip to content

Commit 70e1680

Browse files
committed
Auto merge of rust-lang#146683 - clarfonthey:safe-intrinsics, r=RalfJung,Amanieu
Mark float intrinsics with no preconditions as safe Note: for ease of reviewing, the list of safe intrinsics is sorted in the first commit, and then safe intrinsics are added in the second commit. All *recently added* float intrinsics have been correctly marked as safe to call due to the fact that they have no preconditions. This adds the remaining float intrinsics which are safe to call to the safe intrinsic list, and removes the unsafe blocks around their calls. --- Side note: this may want a try run before being added to the queue, since I'm not sure if there's any tier-2 code that uses these intrinsics that might not be tested on the usual PR flow. We've already uncovered a few places in subtrees that do this, and it's worth double-checking before clogging up the queue.
2 parents 9164e8b + d3121ac commit 70e1680

File tree

13 files changed

+150
-178
lines changed

13 files changed

+150
-178
lines changed

compiler-builtins/libm/src/math/support/float_traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ macro_rules! float_impl {
289289
cfg_if! {
290290
// fma is not yet available in `core`
291291
if #[cfg(intrinsics_enabled)] {
292-
unsafe{ core::intrinsics::$fma_intrinsic(self, y, z) }
292+
core::intrinsics::$fma_intrinsic(self, y, z)
293293
} else {
294294
super::super::$fma_fn(self, y, z)
295295
}

0 commit comments

Comments
 (0)