11#![ feature( staged_api) ]
2+ #![ feature( const_trait_impl) ]
23#![ stable( feature = "stable" , since = "1.0.0" ) ]
34
45#[ stable( feature = "stable" , since = "1.0.0" ) ]
56pub const fn foo ( ) { } //~ ERROR function has missing const stability attribute
67
78#[ unstable( feature = "unstable" , issue = "none" ) ]
8- pub const fn bar ( ) { } // ok for now
9+ pub const fn bar ( ) { } // ok because function is unstable
910
1011#[ stable( feature = "stable" , since = "1.0.0" ) ]
1112pub struct Foo ;
@@ -14,11 +15,12 @@ impl Foo {
1415 pub const fn foo ( ) { } //~ ERROR associated function has missing const stability attribute
1516
1617 #[ unstable( feature = "unstable" , issue = "none" ) ]
17- pub const fn bar ( ) { } // ok for now
18+ pub const fn bar ( ) { } // ok because function is unstable
1819}
1920
20- // FIXME When #![feature(const_trait_impl)] is stabilized, add tests for const
21- // trait impls. Right now, a "trait methods cannot be stable const fn" error is
22- // emitted, but that's not in the scope of this test.
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.
2325
2426fn main ( ) { }
0 commit comments