summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-consts/associated-const-const-eval.rs
blob: 5a34bb97ca5dec2a8bc7a4077ce77d08b98ec429 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// run-pass

trait Foo {
    const NUM: usize;
}

impl Foo for i32 {
    const NUM: usize = 1;
}

const FOO: usize = <i32 as Foo>::NUM;

fn main() {
    assert_eq!(1, FOO);

    match 1 {
        <i32 as Foo>::NUM => {},
        _ => assert!(false)
    }
}