summary refs log tree commit diff
path: root/src/test/ui/internal/internal-unstable-const.rs
blob: 470262a15ba0dea88f7e7bf4871ae79b3def2273 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Don't allow unstable features in stable functions without `allow_internal_unstable`.

#![stable(feature = "rust1", since = "1.0.0")]

#![feature(staged_api)]
#![feature(const_transmute)]

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const fn foo() -> i32 {
    unsafe { std::mem::transmute(4u32) } //~ ERROR `transmute`
}

fn main() {}