]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-fn-not-in-trait.rs
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
[rust.git] / src / test / ui / consts / const-fn-not-in-trait.rs
1 // Test that const fn is illegal in a trait declaration, whether or
2 // not a default is provided.
3
4 #![feature(const_fn)]
5
6 trait Foo {
7     const fn f() -> u32;
8     //~^ ERROR trait fns cannot be declared const
9     const fn g() -> u32 { 0 }
10     //~^ ERROR trait fns cannot be declared const
11 }
12
13 fn main() { }