about summary refs log tree commit diff
path: root/tests/ui/implied-bounds/implied-bounds-unconstrained-2.rs
blob: 125d31c5f9aa71089d64f24334660dae4a7faf11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
//@ check-pass

// Another minimized regression test for #112832.
trait Trait {
    type Assoc;
}

trait Sub<'a>: Trait<Assoc = <Self as Sub<'a>>::SubAssoc> {
    type SubAssoc;
}

// By using the where-clause we normalize `<T as Trait>::Assoc` to
// `<T as Sub<'a>>::SubAssoc` where `'a` is an unconstrained region
// variable.
fn foo<T>(x: <T as Trait>::Assoc)
where
    for<'a> T: Sub<'a>,
{}

fn main() {}