summaryrefslogtreecommitdiffstats
path: root/tests/ui/associated-consts/associated-const-generic-obligations.rs
blob: 498e315b5c83cf4cef698f15596353ee8612eed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
trait Foo {
    type Out: Sized;
}

impl Foo for String {
    type Out = String;
}

trait Bar: Foo {
    const FROM: Self::Out;
}

impl<T: Foo> Bar for T {
    const FROM: &'static str = "foo";
    //~^ ERROR implemented const `FROM` has an incompatible type for trait [E0326]
}

fn main() {}