diff options
Diffstat (limited to 'compiler/rustc_trait_selection/src/traits/select/confirmation.rs')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/select/confirmation.rs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index b2d2f1188c3..80f71c78993 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -166,10 +166,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ) .break_value() .expect("expected to index into clause that exists"); - let candidate = candidate_predicate + let candidate_predicate = candidate_predicate .as_trait_clause() - .expect("projection candidate is not a trait predicate") - .map_bound(|t| t.trait_ref); + .expect("projection candidate is not a trait predicate"); + let candidate_predicate = + util::lazily_elaborate_sizedness_candidate(self.infcx, obligation, candidate_predicate); + + let candidate = candidate_predicate.map_bound(|t| t.trait_ref); let candidate = self.infcx.instantiate_binder_with_fresh_vars( obligation.cause.span, @@ -226,6 +229,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { ) -> PredicateObligations<'tcx> { debug!(?obligation, ?param, "confirm_param_candidate"); + let param = util::lazily_elaborate_sizedness_candidate( + self.infcx, + obligation, + param.upcast(self.infcx.tcx), + ) + .map_bound(|p| p.trait_ref); + // During evaluation, we already checked that this // where-clause trait-ref could be unified with the obligation // trait-ref. Repeat that unification now without any |
