Skip to content

Commit 359de44

Browse files
committed
make the new intrinsics safe
1 parent 023ac46 commit 359de44

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Diff for: core/src/intrinsics/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2748,13 +2748,13 @@ pub unsafe fn truncf128(_x: f128) -> f128 {
27482748
#[rustc_intrinsic_must_be_overridden]
27492749
#[rustc_nounwind]
27502750
#[cfg(not(bootstrap))]
2751-
pub unsafe fn round_ties_even_f16(_x: f16) -> f16 {
2751+
pub fn round_ties_even_f16(_x: f16) -> f16 {
27522752
unreachable!()
27532753
}
27542754

27552755
/// To be removed on next bootstrap bump.
27562756
#[cfg(bootstrap)]
2757-
pub unsafe fn round_ties_even_f16(x: f16) -> f16 {
2757+
pub fn round_ties_even_f16(x: f16) -> f16 {
27582758
#[rustc_intrinsic]
27592759
#[rustc_intrinsic_must_be_overridden]
27602760
#[rustc_nounwind]
@@ -2775,13 +2775,13 @@ pub unsafe fn round_ties_even_f16(x: f16) -> f16 {
27752775
#[rustc_intrinsic_must_be_overridden]
27762776
#[rustc_nounwind]
27772777
#[cfg(not(bootstrap))]
2778-
pub unsafe fn round_ties_even_f32(_x: f32) -> f32 {
2778+
pub fn round_ties_even_f32(_x: f32) -> f32 {
27792779
unreachable!()
27802780
}
27812781

27822782
/// To be removed on next bootstrap bump.
27832783
#[cfg(bootstrap)]
2784-
pub unsafe fn round_ties_even_f32(x: f32) -> f32 {
2784+
pub fn round_ties_even_f32(x: f32) -> f32 {
27852785
#[rustc_intrinsic]
27862786
#[rustc_intrinsic_must_be_overridden]
27872787
#[rustc_nounwind]
@@ -2802,13 +2802,13 @@ pub unsafe fn round_ties_even_f32(x: f32) -> f32 {
28022802
#[rustc_intrinsic_must_be_overridden]
28032803
#[rustc_nounwind]
28042804
#[cfg(not(bootstrap))]
2805-
pub unsafe fn round_ties_even_f64(_x: f64) -> f64 {
2805+
pub fn round_ties_even_f64(_x: f64) -> f64 {
28062806
unreachable!()
28072807
}
28082808

28092809
/// To be removed on next bootstrap bump.
28102810
#[cfg(bootstrap)]
2811-
pub unsafe fn round_ties_even_f64(x: f64) -> f64 {
2811+
pub fn round_ties_even_f64(x: f64) -> f64 {
28122812
#[rustc_intrinsic]
28132813
#[rustc_intrinsic_must_be_overridden]
28142814
#[rustc_nounwind]
@@ -2829,13 +2829,13 @@ pub unsafe fn round_ties_even_f64(x: f64) -> f64 {
28292829
#[rustc_intrinsic_must_be_overridden]
28302830
#[rustc_nounwind]
28312831
#[cfg(not(bootstrap))]
2832-
pub unsafe fn round_ties_even_f128(_x: f128) -> f128 {
2832+
pub fn round_ties_even_f128(_x: f128) -> f128 {
28332833
unreachable!()
28342834
}
28352835

28362836
/// To be removed on next bootstrap bump.
28372837
#[cfg(bootstrap)]
2838-
pub unsafe fn round_ties_even_f128(x: f128) -> f128 {
2838+
pub fn round_ties_even_f128(x: f128) -> f128 {
28392839
#[rustc_intrinsic]
28402840
#[rustc_intrinsic_must_be_overridden]
28412841
#[rustc_nounwind]

Diff for: std/src/f128.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl f128 {
129129
#[unstable(feature = "f128", issue = "116909")]
130130
#[must_use = "method returns a new number and does not mutate the original value"]
131131
pub fn round_ties_even(self) -> f128 {
132-
unsafe { intrinsics::round_ties_even_f128(self) }
132+
intrinsics::round_ties_even_f128(self)
133133
}
134134

135135
/// Returns the integer part of `self`.

Diff for: std/src/f16.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl f16 {
129129
#[unstable(feature = "f16", issue = "116909")]
130130
#[must_use = "method returns a new number and does not mutate the original value"]
131131
pub fn round_ties_even(self) -> f16 {
132-
unsafe { intrinsics::round_ties_even_f16(self) }
132+
intrinsics::round_ties_even_f16(self)
133133
}
134134

135135
/// Returns the integer part of `self`.

Diff for: std/src/f32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl f32 {
125125
#[stable(feature = "round_ties_even", since = "1.77.0")]
126126
#[inline]
127127
pub fn round_ties_even(self) -> f32 {
128-
unsafe { intrinsics::round_ties_even_f32(self) }
128+
intrinsics::round_ties_even_f32(self)
129129
}
130130

131131
/// Returns the integer part of `self`.

Diff for: std/src/f64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl f64 {
125125
#[stable(feature = "round_ties_even", since = "1.77.0")]
126126
#[inline]
127127
pub fn round_ties_even(self) -> f64 {
128-
unsafe { intrinsics::round_ties_even_f64(self) }
128+
intrinsics::round_ties_even_f64(self)
129129
}
130130

131131
/// Returns the integer part of `self`.

0 commit comments

Comments
 (0)