aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2040.rs
blob: 89895420a4d88a2f279ac9a35f08a3f540ea0071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
trait Foo {
    fn f() -> u32;
}

impl Foo for u32 {
    const fn f() -> u32 {
        // { dg-error "functions in traits cannot be declared .const." "" { target *-*-* } .-1 }
        22
    }
}

fn main() {}