rust/src/test/ui/consts/const-fn-not-in-trait.rs
2018-12-25 21:08:33 -07:00

14 lines
306 B
Rust

// Test that const fn is illegal in a trait declaration, whether or
// not a default is provided.
#![feature(const_fn)]
trait Foo {
const fn f() -> u32;
//~^ ERROR trait fns cannot be declared const
const fn g() -> u32 { 0 }
//~^ ERROR trait fns cannot be declared const
}
fn main() { }