summaryrefslogtreecommitdiffstats
path: root/tests/ui/internal/internal-unstable-const.rs
blob: 4ec2426dfee7d81cb5a9381c665c201993929e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Don't allow unstable features in stable functions without `allow_internal_unstable`.

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

#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const fn foo() -> f32 {
    1.0 + 1.0 //~ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
}

fn main() {}