File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/librustc_traits/lowering Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -209,6 +209,10 @@ fn program_clauses_for_trait<'a, 'tcx>(
209
209
let implemented_from_env = Clause :: ForAll ( ty:: Binder :: bind ( implemented_from_env) ) ;
210
210
211
211
let predicates = & tcx. predicates_defined_on ( def_id) . predicates ;
212
+
213
+ // Warning: these where clauses are not substituted for bound vars yet,
214
+ // so that we don't need to adjust binders in the `FromEnv` rules below
215
+ // (see the FIXME).
212
216
let where_clauses = & predicates
213
217
. iter ( )
214
218
. map ( |( wc, _) | wc. lower ( ) )
@@ -258,6 +262,7 @@ fn program_clauses_for_trait<'a, 'tcx>(
258
262
// `WellFormed(WC)`
259
263
let wf_conditions = where_clauses
260
264
. into_iter ( )
265
+ . map ( |wc| wc. subst ( tcx, bound_vars) )
261
266
. map ( |wc| wc. map_bound ( |goal| goal. into_well_formed_goal ( ) ) ) ;
262
267
263
268
// `WellFormed(Self: Trait<P1..Pn>) :- Implemented(Self: Trait<P1..Pn>) && WellFormed(WC)`
@@ -341,7 +346,9 @@ pub fn program_clauses_for_type_def<'a, 'tcx>(
341
346
// `Ty<...>`
342
347
let ty = tcx. type_of ( def_id) . subst ( tcx, bound_vars) ;
343
348
344
- // `WC`
349
+ // Warning: these where clauses are not substituted for bound vars yet,
350
+ // so that we don't need to adjust binders in the `FromEnv` rules below
351
+ // (see the FIXME).
345
352
let where_clauses = tcx. predicates_of ( def_id) . predicates
346
353
. iter ( )
347
354
. map ( |( wc, _) | wc. lower ( ) )
You can’t perform that action at this time.
0 commit comments