@@ -85,9 +85,20 @@ impl<I: Interner> CoherenceSolver<'_, I> {
8585
8686 let interner = self . db . interner ( ) ;
8787
88+ let ( lhs_binders, lhs_bound) = lhs. binders . as_ref ( ) . into ( ) ;
89+ let ( rhs_binders, rhs_bound) = rhs. binders . as_ref ( ) . into ( ) ;
90+
8891 // Upshift the rhs variables in params to account for the joined binders
89- let lhs_params = params ( interner, lhs) . iter ( ) . cloned ( ) ;
90- let rhs_params = params ( interner, rhs)
92+ let lhs_params = lhs_bound
93+ . trait_ref
94+ . substitution
95+ . parameters ( interner)
96+ . iter ( )
97+ . cloned ( ) ;
98+ let rhs_params = rhs_bound
99+ . trait_ref
100+ . substitution
101+ . parameters ( interner)
91102 . iter ( )
92103 . map ( |param| param. shifted_in ( interner) ) ;
93104
@@ -98,10 +109,8 @@ impl<I: Interner> CoherenceSolver<'_, I> {
98109 . map ( |( a, b) | GoalData :: EqGoal ( EqGoal { a, b } ) . intern ( interner) ) ;
99110
100111 // Upshift the rhs variables in where clauses
101- let lhs_where_clauses = lhs. binders . value . where_clauses . iter ( ) . cloned ( ) ;
102- let rhs_where_clauses = rhs
103- . binders
104- . value
112+ let lhs_where_clauses = lhs_bound. where_clauses . iter ( ) . cloned ( ) ;
113+ let rhs_where_clauses = rhs_bound
105114 . where_clauses
106115 . iter ( )
107116 . map ( |wc| wc. shifted_in ( interner) ) ;
@@ -114,16 +123,8 @@ impl<I: Interner> CoherenceSolver<'_, I> {
114123 // Join all the goals we've created together with And, then quantify them
115124 // over the joined binders. This is our query.
116125 let goal = Box :: new ( Goal :: all ( interner, params_goals. chain ( wc_goals) ) )
117- . quantify (
118- interner,
119- QuantifierKind :: Exists ,
120- lhs. binders . binders . clone ( ) ,
121- )
122- . quantify (
123- interner,
124- QuantifierKind :: Exists ,
125- rhs. binders . binders . clone ( ) ,
126- )
126+ . quantify ( interner, QuantifierKind :: Exists , lhs_binders)
127+ . quantify ( interner, QuantifierKind :: Exists , rhs_binders)
127128 . compatible ( interner)
128129 . negate ( interner) ;
129130
@@ -267,12 +268,3 @@ impl<I: Interner> CoherenceSolver<'_, I> {
267268 result
268269 }
269270}
270-
271- fn params < ' a , I : Interner > ( interner : & I , impl_datum : & ' a ImplDatum < I > ) -> & ' a [ Parameter < I > ] {
272- impl_datum
273- . binders
274- . value
275- . trait_ref
276- . substitution
277- . parameters ( interner)
278- }
0 commit comments