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::
This commit is contained in:
parent
b8d25bdefa
commit
e18318ccf5
2 changed files with 2 additions and 15 deletions
|
|
@ -13,7 +13,6 @@
|
|||
proc_macro_hygiene,
|
||||
stmt_expr_attributes,
|
||||
core_intrinsics,
|
||||
intrinsics,
|
||||
no_core,
|
||||
fmt_helpers_for_derive,
|
||||
rustc_attrs,
|
||||
|
|
|
|||
|
|
@ -674,15 +674,9 @@ mod sealed {
|
|||
pub unsafe fn $fun(a: isize, b: *const $ty) -> t_t_l!($ty) {
|
||||
let addr = (b as *const u8).offset(a);
|
||||
|
||||
// Workaround ptr::copy_nonoverlapping not being inlined
|
||||
unsafe extern "rust-intrinsic" {
|
||||
#[rustc_nounwind]
|
||||
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
|
||||
}
|
||||
|
||||
let mut r = mem::MaybeUninit::uninit();
|
||||
|
||||
copy_nonoverlapping(
|
||||
crate::ptr::copy_nonoverlapping(
|
||||
addr,
|
||||
r.as_mut_ptr() as *mut u8,
|
||||
mem::size_of::<t_t_l!($ty)>(),
|
||||
|
|
@ -729,13 +723,7 @@ mod sealed {
|
|||
pub unsafe fn $fun(s: t_t_l!($ty), a: isize, b: *mut $ty) {
|
||||
let addr = (b as *mut u8).offset(a);
|
||||
|
||||
// Workaround ptr::copy_nonoverlapping not being inlined
|
||||
unsafe extern "rust-intrinsic" {
|
||||
#[rustc_nounwind]
|
||||
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
|
||||
}
|
||||
|
||||
copy_nonoverlapping(
|
||||
crate::ptr::copy_nonoverlapping(
|
||||
&s as *const _ as *const u8,
|
||||
addr,
|
||||
mem::size_of::<t_t_l!($ty)>(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue