2020-09-25 13:51:52 -07:00
|
|
|
#![feature(staged_api)]
|
2021-11-17 21:06:17 -05:00
|
|
|
#![stable(feature = "stable", since = "1.0.0")]
|
2020-09-25 13:51:52 -07:00
|
|
|
|
2021-11-17 21:06:17 -05:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub const fn foo() {} //~ ERROR function has missing const stability attribute
|
2020-09-25 13:51:52 -07:00
|
|
|
|
2021-11-17 21:06:17 -05:00
|
|
|
#[unstable(feature = "unstable", issue = "none")]
|
|
|
|
pub const fn bar() {} // ok for now
|
2020-09-25 13:51:52 -07:00
|
|
|
|
2021-11-17 21:06:17 -05:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub struct Foo;
|
|
|
|
impl Foo {
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub const fn foo() {} //~ ERROR associated function has missing const stability attribute
|
|
|
|
|
|
|
|
#[unstable(feature = "unstable", issue = "none")]
|
|
|
|
pub const fn bar() {} // ok for now
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME When #![feature(const_trait_impl)] is stabilized, add tests for const
|
|
|
|
// trait impls. Right now, a "trait methods cannot be stable const fn" error is
|
|
|
|
// emitted, but that's not in the scope of this test.
|
2020-09-25 13:51:52 -07:00
|
|
|
|
|
|
|
fn main() {}
|