about summary refs log tree commit diff
path: root/tests/ui/issues/issue-42956.rs
blob: a124ca84f3c345742d0e3a5e2bac25cff7d70c1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//@ check-pass
#![allow(dead_code)]
#![allow(stable_features)]
#![feature(associated_consts)]

impl A for i32 {
    type Foo = u32;
}
impl B for u32 {
    const BAR: i32 = 0;
}

trait A {
    type Foo: B;
}

trait B {
    const BAR: i32;
}

fn generic<T: A>() {
    // This panics if the universal function call syntax is used as well
    println!("{}", T::Foo::BAR);
}

fn main() {}