]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-fn-not-in-trait.rs
Do not suggest `let_else` if no bindings would be introduced
[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, and even with the feature gate.
3
4 trait Foo {
5     const fn f() -> u32;
6     //~^ ERROR functions in traits cannot be declared const
7     const fn g() -> u32 {
8         //~^ ERROR functions in traits cannot be declared const
9         0
10     }
11 }
12
13 fn main() {}