File tree Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Expand file tree Collapse file tree 2 files changed +30
-5
lines changed Original file line number Diff line number Diff line change @@ -820,13 +820,14 @@ fn push_alias_alias_eq_clause<I: Interner>(
820
820
// <<X as Y>::A as Z>::B == U :- <T as Z>::B == U, <X as Y>::A == T
821
821
// }
822
822
builder. push_binders ( binders, |builder, bound_var| {
823
+ let ( _, trait_args, assoc_args) = builder. db . split_projection ( & projection_ty) ;
823
824
let fresh_self_subst = Substitution :: from_iter (
824
825
interner,
825
- std :: iter :: once ( bound_var . clone ( ) . cast ( interner ) ) . chain (
826
- projection_ty . substitution . as_slice ( interner ) [ 1 .. ]
827
- . iter ( )
828
- . cloned ( ) ,
829
- ) ,
826
+ assoc_args
827
+ . iter ( )
828
+ . cloned ( )
829
+ . chain ( std :: iter :: once ( bound_var . clone ( ) . cast ( interner ) ) )
830
+ . chain ( trait_args [ 1 .. ] . iter ( ) . cloned ( ) ) ,
830
831
) ;
831
832
let fresh_alias = AliasTy :: Projection ( ProjectionTy {
832
833
associated_ty_id : projection_ty. associated_ty_id ,
Original file line number Diff line number Diff line change @@ -609,6 +609,30 @@ fn normalize_gat_with_higher_ranked_trait_bound() {
609
609
}
610
610
}
611
611
612
+ #[ test]
613
+ fn gat_in_alias_in_alias_eq ( ) {
614
+ test ! {
615
+ program {
616
+ trait Foo {
617
+ type Rebind <U >: Foo ;
618
+ }
619
+
620
+ struct S <T > { }
621
+ impl <T > Foo for S <T > {
622
+ type Rebind <U > = S <U >;
623
+ }
624
+ }
625
+
626
+ goal {
627
+ exists<T > {
628
+ <<S <u32 > as Foo >:: Rebind <i32 > as Foo >:: Rebind <usize >: Foo
629
+ }
630
+ } yields {
631
+ expect![ [ r#"Unique"# ] ]
632
+ }
633
+ }
634
+ }
635
+
612
636
#[ test]
613
637
fn forall_projection ( ) {
614
638
test ! {
You can’t perform that action at this time.
0 commit comments