File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -289,21 +289,24 @@ fn program_clauses_for_trait<'a, 'tcx>(
289289 // WellFormed(Self: Trait<P1..Pn>) :- Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)
290290 // }
291291
292- let wellformed_clauses = where_clauses
293- . into_iter ( )
294- . map ( |wc| wc. lower ( ) )
295- // WellFormed(Self: Trait<P1..Pn>) :- Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)
296- . map ( |wc| {
297- wc. map_bound ( |goal| ProgramClause {
298- goal : goal. into_wellformed_goal ( ) ,
299- hypotheses : tcx. mk_goals (
300- where_clauses
301- . into_iter ( )
302- . map ( |wc| Goal :: from_poly_domain_goal ( wc. lower ( ) , tcx) ) ,
303- ) ,
304- } )
305- } )
306- . map ( Clause :: ForAll ) ;
292+ //Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)
293+ let mut extend_where_clauses = vec ! [ ty:: Binder :: dummy( trait_pred. lower( ) ) ] ;
294+ extend_where_clauses. extend (
295+ where_clauses
296+ . into_iter ( )
297+ . map ( |wc| wc. lower ( ) . map_bound ( |wc| wc. into_wellformed_goal ( ) ) ) ,
298+ ) ;
299+
300+ // WellFormed(Self: Trait<P1..Pn>) :- Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)
301+ let clause = ProgramClause {
302+ goal : DomainGoal :: WellFormed ( WellFormed :: Trait ( trait_pred) ) ,
303+ hypotheses : tcx. mk_goals (
304+ extend_where_clauses
305+ . into_iter ( )
306+ . map ( |wc| Goal :: from_poly_domain_goal ( wc, tcx) ) ,
307+ ) ,
308+ } ;
309+ let wellformed_clauses = iter:: once ( Clause :: ForAll ( ty:: Binder :: dummy ( clause) ) ) ;
307310
308311 tcx. mk_clauses (
309312 clauses
You can’t perform that action at this time.
0 commit comments