2015-05-05 07:47:04 -05:00
|
|
|
// Test that const fn is illegal in a trait declaration, whether or
|
2021-04-25 04:02:08 -05:00
|
|
|
// not a default is provided, and even with the feature gate.
|
2015-05-05 07:47:04 -05:00
|
|
|
|
|
|
|
trait Foo {
|
2016-08-07 16:33:35 -05:00
|
|
|
const fn f() -> u32;
|
2020-02-11 01:19:21 -06:00
|
|
|
//~^ ERROR functions in traits cannot be declared const
|
|
|
|
const fn g() -> u32 {
|
|
|
|
//~^ ERROR functions in traits cannot be declared const
|
|
|
|
0
|
|
|
|
}
|
2015-05-05 07:47:04 -05:00
|
|
|
}
|
|
|
|
|
2020-02-11 01:19:21 -06:00
|
|
|
fn main() {}
|