2015-05-05 08:47:04 -04:00
|
|
|
// Test that const fn is illegal in a trait declaration, whether or
|
|
|
|
// not a default is provided.
|
|
|
|
|
|
|
|
#![feature(const_fn)]
|
|
|
|
|
|
|
|
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() {}
|