summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/const-fn-in-trait.rs
blob: e04d59c58c22bfa86c4f021c66f6ef21d2a29c77 (plain)
1
2
3
4
5
6
7
8
9
10
11
trait Foo {
    fn f() -> u32;
    const fn g(); //~ ERROR cannot be declared const
}

impl Foo for u32 {
    const fn f() -> u32 { 22 } //~ ERROR cannot be declared const
    fn g() {}
}

fn main() { }