From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/consts/intrinsic_without_const_stab.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/consts/intrinsic_without_const_stab.rs (limited to 'tests/ui/consts/intrinsic_without_const_stab.rs') diff --git a/tests/ui/consts/intrinsic_without_const_stab.rs b/tests/ui/consts/intrinsic_without_const_stab.rs new file mode 100644 index 000000000..40ec65d51 --- /dev/null +++ b/tests/ui/consts/intrinsic_without_const_stab.rs @@ -0,0 +1,17 @@ +#![feature(intrinsics, staged_api)] +#![stable(feature = "core", since = "1.6.0")] + +#[stable(feature = "rust1", since = "1.0.0")] +#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")] +#[inline] +pub const unsafe fn copy(src: *const T, dst: *mut T, count: usize) { + // Const stability attributes are not inherited from parent items. + extern "rust-intrinsic" { + fn copy(src: *const T, dst: *mut T, count: usize); + } + + unsafe { copy(src, dst, count) } + //~^ ERROR cannot call non-const fn +} + +fn main() {} -- cgit v1.2.3