File tree 2 files changed +71
-1
lines changed
2 files changed +71
-1
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ impl WfSolver {
325
325
let goal = Goal :: Implies ( hypotheses, Box :: new ( goal) )
326
326
. quantify ( QuantifierKind :: ForAll , impl_datum. binders . binders . clone ( ) ) ;
327
327
328
- println ! ( "{:?}" , goal) ;
328
+ debug ! ( "WF trait goal: {:?}" , goal) ;
329
329
330
330
match self . solver_choice . solve_root_goal ( & self . env , & goal. into_closed_goal ( ) ) . unwrap ( ) {
331
331
Some ( sol) => sol. is_unique ( ) ,
Original file line number Diff line number Diff line change @@ -669,6 +669,76 @@ fn normalize_gat_with_where_clause() {
669
669
}
670
670
}
671
671
672
+ #[ test]
673
+ fn normalize_gat_with_where_clause2 ( ) {
674
+ test ! {
675
+ program {
676
+ trait Bar <T > { }
677
+ trait Foo <T > {
678
+ type Item <U > where U : Bar <T >;
679
+ }
680
+
681
+ struct i32 { }
682
+ impl <T > Foo <T > for i32 {
683
+ type Item <U > = U ;
684
+ }
685
+ }
686
+
687
+ goal {
688
+ forall<T , U > {
689
+ exists<V > {
690
+ Normalize ( <i32 as Foo <T >>:: Item <U > -> V )
691
+ }
692
+ }
693
+ } yields {
694
+ "No possible solution"
695
+ }
696
+
697
+ goal {
698
+ forall<T , U > {
699
+ exists<V > {
700
+ if ( U : Bar <T >) {
701
+ Normalize ( <i32 as Foo <T >>:: Item <U > -> V )
702
+ }
703
+ }
704
+ }
705
+ } yields {
706
+ "Unique; substitution [?0 := !2]"
707
+ }
708
+ }
709
+ }
710
+
711
+ #[ test]
712
+ fn normalize_gat_with_higher_ranked_trait_bound ( ) {
713
+ test ! {
714
+ program {
715
+ trait Foo <' a, T > { }
716
+ struct i32 { }
717
+
718
+ trait Bar <' a, T > {
719
+ type Item <V >: Foo <' a, T > where forall<' b> V : Foo <' b, T >;
720
+ }
721
+
722
+ impl <' a, T > Foo <' a, T > for i32 { }
723
+ impl <' a, T > Bar <' a, T > for i32 {
724
+ type Item <V > = i32 ;
725
+ }
726
+ }
727
+
728
+ goal {
729
+ forall<' a, T , V > {
730
+ if ( forall<' b> { V : Foo <' b, T > } ) {
731
+ exists<U > {
732
+ Normalize ( <i32 as Bar <' a, T >>:: Item <V > -> U )
733
+ }
734
+ }
735
+ }
736
+ } yields {
737
+ "Unique; substitution [?0 := i32], lifetime constraints []"
738
+ }
739
+ }
740
+ }
741
+
672
742
#[ test]
673
743
fn normalize_implied_bound ( ) {
674
744
test ! {
You can’t perform that action at this time.
0 commit comments