]> git.proxmox.com Git - rustc.git/blob - src/test/ui/internal/internal-unstable-const.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / internal / internal-unstable-const.rs
1 // Don't allow unstable features in stable functions without `allow_internal_unstable`.
2
3 #![stable(feature = "rust1", since = "1.0.0")]
4 #![feature(staged_api)]
5 #![feature(const_fn_floating_point_arithmetic)]
6
7 #[stable(feature = "rust1", since = "1.0.0")]
8 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
9 pub const fn foo() -> f32 {
10 1.0 + 1.0 //~ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
11 }
12
13 fn main() {}