2022-05-22 12:29:54 +00:00
|
|
|
#![feature(intrinsics, staged_api)]
|
2021-01-04 23:01:58 +00:00
|
|
|
#![stable(feature = "core", since = "1.6.0")]
|
|
|
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
2022-05-22 12:29:54 +00:00
|
|
|
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
|
2021-01-04 23:01:58 +00:00
|
|
|
#[inline]
|
|
|
|
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
|
2021-01-16 19:59:21 +00:00
|
|
|
// Const stability attributes are not inherited from parent items.
|
2021-01-04 23:01:58 +00:00
|
|
|
extern "rust-intrinsic" {
|
|
|
|
fn copy<T>(src: *const T, dst: *mut T, count: usize);
|
|
|
|
}
|
|
|
|
|
|
|
|
unsafe { copy(src, dst, count) }
|
2021-12-09 17:10:05 +00:00
|
|
|
//~^ ERROR cannot call non-const fn
|
2021-01-04 23:01:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|