Skip to content

Commit e593e9a

Browse files
RalfJunggitbot
authored and
gitbot
committedMar 6, 2025
make the new intrinsics safe
1 parent b3f6df4 commit e593e9a

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed
 

‎core/src/intrinsics/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -2740,13 +2740,13 @@ pub unsafe fn truncf128(_x: f128) -> f128 {
27402740
#[rustc_intrinsic_must_be_overridden]
27412741
#[rustc_nounwind]
27422742
#[cfg(not(bootstrap))]
2743-
pub unsafe fn round_ties_even_f16(_x: f16) -> f16 {
2743+
pub fn round_ties_even_f16(_x: f16) -> f16 {
27442744
unreachable!()
27452745
}
27462746

27472747
/// To be removed on next bootstrap bump.
27482748
#[cfg(bootstrap)]
2749-
pub unsafe fn round_ties_even_f16(x: f16) -> f16 {
2749+
pub fn round_ties_even_f16(x: f16) -> f16 {
27502750
#[rustc_intrinsic]
27512751
#[rustc_intrinsic_must_be_overridden]
27522752
#[rustc_nounwind]
@@ -2767,13 +2767,13 @@ pub unsafe fn round_ties_even_f16(x: f16) -> f16 {
27672767
#[rustc_intrinsic_must_be_overridden]
27682768
#[rustc_nounwind]
27692769
#[cfg(not(bootstrap))]
2770-
pub unsafe fn round_ties_even_f32(_x: f32) -> f32 {
2770+
pub fn round_ties_even_f32(_x: f32) -> f32 {
27712771
unreachable!()
27722772
}
27732773

27742774
/// To be removed on next bootstrap bump.
27752775
#[cfg(bootstrap)]
2776-
pub unsafe fn round_ties_even_f32(x: f32) -> f32 {
2776+
pub fn round_ties_even_f32(x: f32) -> f32 {
27772777
#[rustc_intrinsic]
27782778
#[rustc_intrinsic_must_be_overridden]
27792779
#[rustc_nounwind]
@@ -2794,13 +2794,13 @@ pub unsafe fn round_ties_even_f32(x: f32) -> f32 {
27942794
#[rustc_intrinsic_must_be_overridden]
27952795
#[rustc_nounwind]
27962796
#[cfg(not(bootstrap))]
2797-
pub unsafe fn round_ties_even_f64(_x: f64) -> f64 {
2797+
pub fn round_ties_even_f64(_x: f64) -> f64 {
27982798
unreachable!()
27992799
}
28002800

28012801
/// To be removed on next bootstrap bump.
28022802
#[cfg(bootstrap)]
2803-
pub unsafe fn round_ties_even_f64(x: f64) -> f64 {
2803+
pub fn round_ties_even_f64(x: f64) -> f64 {
28042804
#[rustc_intrinsic]
28052805
#[rustc_intrinsic_must_be_overridden]
28062806
#[rustc_nounwind]
@@ -2821,13 +2821,13 @@ pub unsafe fn round_ties_even_f64(x: f64) -> f64 {
28212821
#[rustc_intrinsic_must_be_overridden]
28222822
#[rustc_nounwind]
28232823
#[cfg(not(bootstrap))]
2824-
pub unsafe fn round_ties_even_f128(_x: f128) -> f128 {
2824+
pub fn round_ties_even_f128(_x: f128) -> f128 {
28252825
unreachable!()
28262826
}
28272827

28282828
/// To be removed on next bootstrap bump.
28292829
#[cfg(bootstrap)]
2830-
pub unsafe fn round_ties_even_f128(x: f128) -> f128 {
2830+
pub fn round_ties_even_f128(x: f128) -> f128 {
28312831
#[rustc_intrinsic]
28322832
#[rustc_intrinsic_must_be_overridden]
28332833
#[rustc_nounwind]

‎std/src/f128.rs

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

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

‎std/src/f16.rs

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

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

‎std/src/f32.rs

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

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

‎std/src/f64.rs

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.