Stabilize const_intrinsic_copy
This commit is contained in:
parent
e45d9973b2
commit
2b58e6314a
10 changed files with 19 additions and 22 deletions
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
// ignore-tidy-linelength
|
||||
#![feature(intrinsics, staged_api)]
|
||||
#![feature(const_mut_refs, const_intrinsic_copy)]
|
||||
#![feature(const_mut_refs)]
|
||||
use std::mem;
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
|
||||
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
|
||||
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
|
||||
|
||||
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
|
||||
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
|
||||
fn copy<T>(src: *const T, dst: *mut T, count: usize);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#![feature(intrinsics, staged_api, const_intrinsic_copy)]
|
||||
#![feature(intrinsics, staged_api)]
|
||||
#![stable(feature = "core", since = "1.6.0")]
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
|
||||
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
|
||||
#[inline]
|
||||
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
|
||||
// Const stability attributes are not inherited from parent items.
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(intrinsics, staged_api, const_intrinsic_copy)]
|
||||
#![feature(intrinsics, staged_api)]
|
||||
#![stable(feature = "core", since = "1.6.0")]
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
|
|
@ -6,7 +6,7 @@ extern "rust-intrinsic" {
|
|||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
|
||||
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
|
||||
#[inline]
|
||||
pub const unsafe fn stuff<T>(src: *const T, dst: *mut T, count: usize) {
|
||||
unsafe { copy(src, dst, count) } //~ ERROR cannot call non-const fn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue