Skip to content

Commit 9aee3bc

Browse files
committed
Auto merge of rust-lang#80707 - oli-obk:stability_hole_const_intrinsics, r=RalfJung
Stability oddity with const intrinsics cc `@RalfJung` In rust-lang#80699 (comment) `@usbalbin` realized we accepted some intrinsics as `const` without a `#[rustc_const_(un)stable]` attribute. I did some digging, and that example works because intrinsics inherit their stability from their parents... including `#[rustc_const_(un)stable]` attributes. While we may want to fix that (not sure, wasn't there just a MCPed PR that caused this on purpose?), we definitely want tests for it, thus this PR adding tests and some fun tracing statements.
2 parents 3995a15 + de5fd27 commit 9aee3bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/intrinsics.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,6 +1842,7 @@ pub(crate) fn is_nonoverlapping<T>(src: *const T, dst: *const T, count: usize) -
18421842
#[inline]
18431843
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
18441844
extern "rust-intrinsic" {
1845+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
18451846
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
18461847
}
18471848

@@ -1926,6 +1927,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
19261927
#[inline]
19271928
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
19281929
extern "rust-intrinsic" {
1930+
#[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
19291931
fn copy<T>(src: *const T, dst: *mut T, count: usize);
19301932
}
19311933

0 commit comments

Comments
 (0)