mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
14 lines
463 B
Rust
14 lines
463 B
Rust
// 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() {}
|