File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ check-pass
2+ //! Tests that associated type projections normalize properly in the presence of HRTBs.
3+ //! Original issue: <https://github.com/rust-lang/rust/issues/30472>
4+
5+
6+ pub trait MyFrom < T > { }
7+ impl < T > MyFrom < T > for T { }
8+
9+ pub trait MyInto < T > { }
10+ impl < T , U > MyInto < U > for T where U : MyFrom < T > { }
11+
12+
13+ pub trait A < ' self_ > {
14+ type T ;
15+ }
16+ pub trait B : for < ' self_ > A < ' self_ > {
17+ // Originally caused the `type U = usize` example below to fail with a type mismatch error
18+ type U : for < ' self_ > MyFrom < <Self as A < ' self_ > >:: T > ;
19+ }
20+
21+
22+ pub struct M ;
23+ impl < ' self_ > A < ' self_ > for M {
24+ type T = usize ;
25+ }
26+
27+ impl B for M {
28+ type U = usize ;
29+ }
30+
31+
32+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments