@@ -27,7 +27,7 @@ impl Program {
27
27
// goal. In this case, success is an error - it means that there is at
28
28
// least one type in the intersection of these two impls.
29
29
for ( lhs, rhs) in impls. into_iter ( ) . tuple_combinations ( ) {
30
- match solver. solve_goal ( intersection_of ( lhs, rhs) ) {
30
+ match solver. solve_closed_goal ( intersection_of ( lhs, rhs) ) {
31
31
Ok ( _) => {
32
32
let trait_id = self . type_kinds . get ( & trait_id) . unwrap ( ) . name ;
33
33
Err ( Error :: from_kind ( ErrorKind :: OverlappingImpls ( trait_id) ) )
@@ -46,7 +46,7 @@ impl Program {
46
46
// If this goal succeeds, these two impls overlap.
47
47
//
48
48
// We combine the binders of the two impls & treat them as existential
49
- // quantifiers. Then we attempt to unify the input types to treat provided
49
+ // quantifiers. Then we attempt to unify the input types to the trait provided
50
50
// by each impl, as well as prove that the where clauses from both impls all
51
51
// hold.
52
52
//
@@ -62,16 +62,16 @@ impl Program {
62
62
// impl<T1, U> Foo<T1> for Vec<U> { }
63
63
// impl<T2> Foo<T2> for Vec<i32> { }
64
64
// Generates:
65
- // exists<T1, U, T2> { U = i32, T1 = T2 }
65
+ // exists<T1, U, T2> { Vec<U> = Vec< i32> , T1 = T2 }
66
66
//
67
67
//
68
68
// Impls:
69
69
// impl<T> Foo for Vec<T> where T: Bar { }
70
70
// impl<U> Foo for Vec<U> where U: Baz { }
71
71
// Generates:
72
- // exists<T, U> { T = U , T: Bar, U: Baz }
72
+ // exists<T, U> { Vec<T> = Vec<U> , T: Bar, U: Baz }
73
73
//
74
- fn intersection_of ( lhs : & ImplDatum , rhs : & ImplDatum ) -> Canonical < InEnvironment < Goal > > {
74
+ fn intersection_of ( lhs : & ImplDatum , rhs : & ImplDatum ) -> InEnvironment < Goal > {
75
75
fn params ( impl_datum : & ImplDatum ) -> & [ Parameter ] {
76
76
& impl_datum. binders . value . trait_ref . parameters
77
77
}
@@ -108,8 +108,5 @@ fn intersection_of(lhs: &ImplDatum, rhs: &ImplDatum) -> Canonical<InEnvironment<
108
108
. expect ( "Every trait takes at least one input type" )
109
109
. quantify ( QuantifierKind :: Exists , binders) ;
110
110
111
- Canonical {
112
- value : InEnvironment :: empty ( goal) ,
113
- binders : vec ! [ ] ,
114
- }
111
+ InEnvironment :: empty ( goal)
115
112
}
0 commit comments