summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/assume-gat-normalization-for-nested-goals.rs
blob: e2d51c6649ab926d3b76fcd21c30ec787f6fabeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// known-bug: #117606

#![feature(associated_type_defaults)]

trait Foo {
    type Bar<T>: Baz<Self> = i32;
    // We should be able to prove that `i32: Baz<Self>` because of
    // the impl below, which requires that `Self::Bar<()>: Eq<i32>`
    // which is true, because we assume `for<T> Self::Bar<T> = i32`.
}

trait Baz<T: ?Sized> {}
impl<T: Foo + ?Sized> Baz<T> for i32 where T::Bar<()>: Eq<i32> {}

trait Eq<T> {}
impl<T> Eq<T> for T {}

fn main() {}