Skip to content

Commit b12757c

Browse files
committed
replaced extern "rust-intrinsic" block with core::ptr::copy_nonoverlapping
using core::ptr::copy_nonoverlapping for memory operations changes core::ptr::coopy_nonoverlapping to crate::ptr::
1 parent a70790e commit b12757c

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

crates/core_arch/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
proc_macro_hygiene,
1414
stmt_expr_attributes,
1515
core_intrinsics,
16-
intrinsics,
1716
no_core,
1817
fmt_helpers_for_derive,
1918
rustc_attrs,

crates/core_arch/src/powerpc/altivec.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -687,15 +687,9 @@ mod sealed {
687687
pub unsafe fn $fun(a: isize, b: *const $ty) -> t_t_l!($ty) {
688688
let addr = (b as *const u8).offset(a);
689689

690-
// Workaround ptr::copy_nonoverlapping not being inlined
691-
unsafe extern "rust-intrinsic" {
692-
#[rustc_nounwind]
693-
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
694-
}
695-
696690
let mut r = mem::MaybeUninit::uninit();
697691

698-
copy_nonoverlapping(
692+
crate::ptr::copy_nonoverlapping(
699693
addr,
700694
r.as_mut_ptr() as *mut u8,
701695
mem::size_of::<t_t_l!($ty)>(),
@@ -742,13 +736,7 @@ mod sealed {
742736
pub unsafe fn $fun(s: t_t_l!($ty), a: isize, b: *mut $ty) {
743737
let addr = (b as *mut u8).offset(a);
744738

745-
// Workaround ptr::copy_nonoverlapping not being inlined
746-
unsafe extern "rust-intrinsic" {
747-
#[rustc_nounwind]
748-
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
749-
}
750-
751-
copy_nonoverlapping(
739+
crate::ptr::copy_nonoverlapping(
752740
&s as *const _ as *const u8,
753741
addr,
754742
mem::size_of::<t_t_l!($ty)>(),

0 commit comments

Comments
 (0)