rust/tests/ui/consts/intrinsic_without_const_stab_fail.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
461 B
Rust
Raw Normal View History

2022-05-22 07:29:54 -05:00
#![feature(intrinsics, staged_api)]
2021-01-04 17:01:58 -06:00
#![stable(feature = "core", since = "1.6.0")]
extern "rust-intrinsic" {
fn copy<T>(src: *const T, dst: *mut T, count: usize);
}
#[stable(feature = "rust1", since = "1.0.0")]
2022-05-22 07:29:54 -05:00
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
2021-01-04 17:01:58 -06:00
#[inline]
pub const unsafe fn stuff<T>(src: *const T, dst: *mut T, count: usize) {
2021-12-09 11:10:05 -06:00
unsafe { copy(src, dst, count) } //~ ERROR cannot call non-const fn
2021-01-04 17:01:58 -06:00
}
fn main() {}