mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
14 lines
350 B
Rust
14 lines
350 B
Rust
// Test that const fn is illegal in a trait declaration, whether or
|
|
// not a default is provided, and even with the feature gate.
|
|
|
|
trait Foo {
|
|
const fn f() -> u32;
|
|
//~^ ERROR functions in traits cannot be declared const
|
|
const fn g() -> u32 {
|
|
//~^ ERROR functions in traits cannot be declared const
|
|
0
|
|
}
|
|
}
|
|
|
|
fn main() {}
|