]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/intrinsic_without_const_stab.rs
Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyup
[rust.git] / src / test / ui / consts / intrinsic_without_const_stab.rs
1 #![feature(intrinsics, staged_api, const_intrinsic_copy)]
2 #![stable(feature = "core", since = "1.6.0")]
3
4 #[stable(feature = "rust1", since = "1.0.0")]
5 #[rustc_const_unstable(feature = "const_intrinsic_copy", issue = "80697")]
6 #[inline]
7 pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
8     // Const stability attributes are not inherited from parent items.
9     extern "rust-intrinsic" {
10         fn copy<T>(src: *const T, dst: *mut T, count: usize);
11     }
12
13     unsafe { copy(src, dst, count) }
14     //~^ ERROR calls in constant functions are limited to constant functions
15 }
16
17 fn main() {}