summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/intrinsic_without_const_stab.rs
blob: 40ec65d51beecc8b988f0aad150d2354c1eb7c8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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<T>(src: *const T, dst: *mut T, count: usize) {
    // Const stability attributes are not inherited from parent items.
    extern "rust-intrinsic" {
        fn copy<T>(src: *const T, dst: *mut T, count: usize);
    }

    unsafe { copy(src, dst, count) }
    //~^ ERROR cannot call non-const fn
}

fn main() {}