]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/const-fn-in-trait.rs
Merge commit '3a31c6d8272c14388a34622193baf553636fe470' into sync_cg_clif-2021-07-07
[rust.git] / src / test / ui / mismatched_types / const-fn-in-trait.rs
1 trait Foo {
2     fn f() -> u32;
3     const fn g(); //~ ERROR cannot be declared const
4 }
5
6 impl Foo for u32 {
7     const fn f() -> u32 { 22 } //~ ERROR cannot be declared const
8     fn g() {}
9 }
10
11 fn main() { }