Require const stability attributes on intrinsics to be able to use them in constant contexts
This commit is contained in:
parent
01a46509a4
commit
9ee16e14c5
6 changed files with 38 additions and 97 deletions
|
|
@ -2,6 +2,8 @@
|
|||
#![feature(const_fn)]
|
||||
#![feature(repr_simd)]
|
||||
#![feature(platform_intrinsics)]
|
||||
#![feature(staged_api)]
|
||||
#![stable(feature = "foo", since = "1.33.7")]
|
||||
#![allow(non_camel_case_types)]
|
||||
|
||||
#[repr(simd)] struct i8x1(i8);
|
||||
|
|
@ -9,7 +11,9 @@
|
|||
#[repr(simd)] struct f32x3(f32, f32, f32);
|
||||
|
||||
extern "platform-intrinsic" {
|
||||
#[rustc_const_stable(feature = "foo", since = "1.3.37")]
|
||||
fn simd_insert<T, U>(x: T, idx: u32, val: U) -> T;
|
||||
#[rustc_const_stable(feature = "foo", since = "1.3.37")]
|
||||
fn simd_extract<T, U>(x: T, idx: u32) -> U;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_type_name)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
const fn type_name_wrapper<T>(_: &T) -> &'static str {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue