1 #![feature(staged_api)]
2 #![feature(const_trait_impl)]
3 #![stable(feature = "stable", since = "1.0.0")]
5 #[stable(feature = "stable", since = "1.0.0")]
6 pub const fn foo() {} //~ ERROR function has missing const stability attribute
8 #[unstable(feature = "unstable", issue = "none")]
9 pub const fn bar() {} // ok because function is unstable
11 #[stable(feature = "stable", since = "1.0.0")]
14 #[stable(feature = "stable", since = "1.0.0")]
15 pub const fn foo() {} //~ ERROR associated function has missing const stability attribute
17 #[unstable(feature = "unstable", issue = "none")]
18 pub const fn bar() {} // ok because function is unstable
21 // FIXME Once #![feature(const_trait_impl)] is allowed to be stable, add a test
22 // for const trait impls. Right now, a "trait methods cannot be stable const fn"
23 // error is emitted. This occurs prior to the lint being tested here, such that
24 // the lint cannot currently be tested on this use case.