Skip to content

Commit 6b06fdf

Browse files
committed
Auto merge of #113194 - lu-zero:intrinsics-inline, r=thomcc
Mark wrapped intrinsics as inline(always) This should mitigate having the inliner decide not to inline when the architecture is lacking an implementation of TargetTransformInfo::areInlineCompatible aware of the target features (e.g. PowerPC as today). See rust-lang/stdarch#1443 (comment)
2 parents 7383ab7 + 528f11c commit 6b06fdf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/core/src/intrinsics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2657,7 +2657,7 @@ pub(crate) fn is_nonoverlapping<T>(src: *const T, dst: *const T, count: usize) -
26572657
#[stable(feature = "rust1", since = "1.0.0")]
26582658
#[rustc_allowed_through_unstable_modules]
26592659
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2660-
#[inline]
2660+
#[inline(always)]
26612661
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
26622662
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
26632663
extern "rust-intrinsic" {
@@ -2748,7 +2748,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
27482748
#[stable(feature = "rust1", since = "1.0.0")]
27492749
#[rustc_allowed_through_unstable_modules]
27502750
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2751-
#[inline]
2751+
#[inline(always)]
27522752
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
27532753
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
27542754
extern "rust-intrinsic" {
@@ -2821,7 +2821,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
28212821
#[stable(feature = "rust1", since = "1.0.0")]
28222822
#[rustc_allowed_through_unstable_modules]
28232823
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
2824-
#[inline]
2824+
#[inline(always)]
28252825
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
28262826
pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
28272827
extern "rust-intrinsic" {

0 commit comments

Comments
 (0)