@@ -92,26 +92,6 @@ impl<I: Interner> context::ResolventOps<I, SlgContext<I>> for TruncatingInferenc
9292 debug ! ( "consequence = {:?}" , consequence) ;
9393 debug ! ( "conditions = {:?}" , conditions) ;
9494
95- let constraints = conditions
96- . iter ( interner)
97- . filter_map ( |c| match c. data ( interner) {
98- GoalData :: DomainGoal ( DomainGoal :: Holds ( WhereClause :: LifetimeOutlives ( a, b) ) ) => {
99- Some ( InEnvironment :: new (
100- environment,
101- Constraint :: Outlives ( a. clone ( ) , b. clone ( ) ) ,
102- ) )
103- }
104- GoalData :: Not ( c1) => match c1. data ( interner) {
105- GoalData :: DomainGoal ( DomainGoal :: Holds ( WhereClause :: LifetimeOutlives (
106- _a,
107- _b,
108- ) ) ) => panic ! ( "Not allowed." ) ,
109- _ => None ,
110- } ,
111- _ => None ,
112- } )
113- . collect ( ) ;
114-
11595 // Unify the selected literal Li with C'.
11696 let unification_result = self
11797 . infer
@@ -121,7 +101,7 @@ impl<I: Interner> context::ResolventOps<I, SlgContext<I>> for TruncatingInferenc
121101 let mut ex_clause = ExClause {
122102 subst : subst. clone ( ) ,
123103 ambiguous : false ,
124- constraints,
104+ constraints : vec ! [ ] ,
125105 subgoals : vec ! [ ] ,
126106 delayed_subgoals : vec ! [ ] ,
127107 answer_time : TimeStamp :: default ( ) ,
@@ -131,26 +111,15 @@ impl<I: Interner> context::ResolventOps<I, SlgContext<I>> for TruncatingInferenc
131111 // Add the subgoals/region-constraints that unification gave us.
132112 slg:: into_ex_clause ( interner, unification_result, & mut ex_clause) ;
133113
134- let conditions_iter = conditions
135- . iter ( interner)
136- . filter ( |c| match c. data ( interner) {
137- GoalData :: DomainGoal ( DomainGoal :: Holds ( WhereClause :: LifetimeOutlives ( ..) ) ) => false ,
138- GoalData :: Not ( c1) => match c1. data ( interner) {
139- GoalData :: DomainGoal ( DomainGoal :: Holds ( WhereClause :: LifetimeOutlives ( ..) ) ) => {
140- false
141- }
142- _ => true ,
143- } ,
144- _ => true ,
145- } )
146- . map ( |c| match c. data ( interner) {
114+ // Add the `conditions` from the program clause into the result too.
115+ ex_clause
116+ . subgoals
117+ . extend ( conditions. iter ( interner) . map ( |c| match c. data ( interner) {
147118 GoalData :: Not ( c1) => {
148119 Literal :: Negative ( InEnvironment :: new ( environment, Goal :: clone ( c1) ) )
149120 }
150121 _ => Literal :: Positive ( InEnvironment :: new ( environment, Goal :: clone ( c) ) ) ,
151- } ) ;
152- // Add the `conditions` from the program clause into the result too.
153- ex_clause. subgoals . extend ( conditions_iter) ;
122+ } ) ) ;
154123
155124 Ok ( ex_clause)
156125 }
0 commit comments