about summary refs log tree commit diff
path: root/tests/ui/methods/supertrait-shadowing/assoc-const.rs
blob: a542ce7d326d1ec0ba49acfa591fa0b94c2bb521 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ run-pass
//@ check-run-results

#![feature(supertrait_item_shadowing)]
#![allow(dead_code)]

trait A {
    const CONST: i32;
}
impl<T> A for T {
    const CONST: i32 = 1;
}

trait B: A {
    const CONST: i32;
}
impl<T> B for T {
    const CONST: i32 = 2;
}

fn main() {
    println!("{}", i32::CONST);
}