2015-05-05 08:47:04 -04:00
|
|
|
// Test that const fn is illegal in a trait declaration, whether or
|
2021-04-25 11:02:08 +02:00
|
|
|
// not a default is provided, and even with the feature gate.
|
2015-05-05 08:47:04 -04:00
|
|
|
|
|
|
|
trait Foo {
|
2016-08-07 14:33:35 -07:00
|
|
|
const fn f() -> u32;
|
2020-02-11 08:19:21 +01: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 08:47:04 -04:00
|
|
|
}
|
|
|
|
|
2020-02-11 08:19:21 +01:00
|
|
|
fn main() {}
|