@@ -22,6 +22,7 @@ use rustc::traits::{
2222 GoalKind ,
2323 PolyDomainGoal ,
2424 ProgramClause ,
25+ ProgramClauseCategory ,
2526 WellFormed ,
2627 WhereClause ,
2728} ;
@@ -204,6 +205,7 @@ fn program_clauses_for_trait<'a, 'tcx>(
204205 let implemented_from_env = ProgramClause {
205206 goal : impl_trait,
206207 hypotheses,
208+ category : ProgramClauseCategory :: ImpliedBound ,
207209 } ;
208210
209211 let clauses = iter:: once ( Clause :: ForAll ( ty:: Binder :: dummy ( implemented_from_env) ) ) ;
@@ -231,6 +233,7 @@ fn program_clauses_for_trait<'a, 'tcx>(
231233 . map ( |wc| wc. map_bound ( |goal| ProgramClause {
232234 goal : goal. into_from_env_goal ( ) ,
233235 hypotheses,
236+ category : ProgramClauseCategory :: ImpliedBound ,
234237 } ) )
235238 . map ( Clause :: ForAll ) ;
236239
@@ -257,6 +260,7 @@ fn program_clauses_for_trait<'a, 'tcx>(
257260 hypotheses : tcx. mk_goals (
258261 wf_conditions. map ( |wc| tcx. mk_goal ( GoalKind :: from_poly_domain_goal ( wc, tcx) ) ) ,
259262 ) ,
263+ category : ProgramClauseCategory :: WellFormed ,
260264 } ;
261265 let wf_clause = iter:: once ( Clause :: ForAll ( ty:: Binder :: dummy ( wf_clause) ) ) ;
262266
@@ -299,6 +303,7 @@ fn program_clauses_for_impl<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId
299303 where_clauses
300304 . map ( |wc| tcx. mk_goal ( GoalKind :: from_poly_domain_goal ( wc, tcx) ) ) ,
301305 ) ,
306+ category : ProgramClauseCategory :: Other ,
302307 } ;
303308 tcx. mk_clauses ( iter:: once ( Clause :: ForAll ( ty:: Binder :: dummy ( clause) ) ) )
304309}
@@ -335,6 +340,7 @@ pub fn program_clauses_for_type_def<'a, 'tcx>(
335340 . cloned ( )
336341 . map ( |wc| tcx. mk_goal ( GoalKind :: from_poly_domain_goal ( wc, tcx) ) ) ,
337342 ) ,
343+ category : ProgramClauseCategory :: WellFormed ,
338344 } ;
339345
340346 let well_formed_clause = iter:: once ( Clause :: ForAll ( ty:: Binder :: dummy ( well_formed) ) ) ;
@@ -360,6 +366,7 @@ pub fn program_clauses_for_type_def<'a, 'tcx>(
360366 . map ( |wc| wc. map_bound ( |goal| ProgramClause {
361367 goal : goal. into_from_env_goal ( ) ,
362368 hypotheses,
369+ category : ProgramClauseCategory :: ImpliedBound ,
363370 } ) )
364371
365372 . map ( Clause :: ForAll ) ;
@@ -407,7 +414,8 @@ pub fn program_clauses_for_associated_type_def<'a, 'tcx>(
407414
408415 let projection_eq_clause = ProgramClause {
409416 goal : DomainGoal :: Holds ( projection_eq) ,
410- hypotheses : & ty:: List :: empty ( ) ,
417+ hypotheses : ty:: List :: empty ( ) ,
418+ category : ProgramClauseCategory :: Other ,
411419 } ;
412420
413421 // Rule WellFormed-AssocTy
@@ -425,6 +433,7 @@ pub fn program_clauses_for_associated_type_def<'a, 'tcx>(
425433 let wf_clause = ProgramClause {
426434 goal : DomainGoal :: WellFormed ( WellFormed :: Ty ( placeholder_ty) ) ,
427435 hypotheses : tcx. mk_goals ( iter:: once ( hypothesis) ) ,
436+ category : ProgramClauseCategory :: Other ,
428437 } ;
429438
430439 // Rule Implied-Trait-From-AssocTy
@@ -441,6 +450,7 @@ pub fn program_clauses_for_associated_type_def<'a, 'tcx>(
441450 let from_env_clause = ProgramClause {
442451 goal : DomainGoal :: FromEnv ( FromEnv :: Trait ( trait_predicate) ) ,
443452 hypotheses : tcx. mk_goals ( iter:: once ( hypothesis) ) ,
453+ category : ProgramClauseCategory :: ImpliedBound ,
444454 } ;
445455
446456 let clauses = iter:: once ( projection_eq_clause)
@@ -506,6 +516,7 @@ pub fn program_clauses_for_associated_type_value<'a, 'tcx>(
506516 . into_iter ( )
507517 . map ( |wc| tcx. mk_goal ( GoalKind :: from_poly_domain_goal ( wc, tcx) ) ) ,
508518 ) ,
519+ category : ProgramClauseCategory :: Other ,
509520 } ;
510521 tcx. mk_clauses ( iter:: once ( Clause :: ForAll ( ty:: Binder :: dummy ( clause) ) ) )
511522}
0 commit comments