2020-06-25 19:43:48 -05:00
|
|
|
// Don't allow unstable features in stable functions without `allow_internal_unstable`.
|
|
|
|
|
2020-05-21 14:49:38 -05:00
|
|
|
#![stable(feature = "rust1", since = "1.0.0")]
|
2020-01-10 20:48:52 -06:00
|
|
|
#![feature(staged_api)]
|
2021-06-03 02:31:27 -05:00
|
|
|
#![feature(const_fn_floating_point_arithmetic)]
|
2020-01-10 20:48:52 -06:00
|
|
|
|
|
|
|
#[stable(feature = "rust1", since = "1.0.0")]
|
|
|
|
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
|
2021-06-03 02:31:27 -05:00
|
|
|
pub const fn foo() -> f32 {
|
|
|
|
1.0 + 1.0 //~ ERROR const-stable function cannot use `#[feature(const_fn_floating_point_arithmetic)]`
|
2020-01-10 20:48:52 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|