Use ty::Binder::bind to fix debug-assertions ICEs

This commit is contained in:
Yuki Okushi 2020-10-10 05:25:53 +09:00
parent fb4d62759b
commit 9f7eab4548

View file

@ -72,7 +72,7 @@ impl<'tcx> Bounds<'tcx> {
.iter() .iter()
.map(|&(region_bound, span)| { .map(|&(region_bound, span)| {
let outlives = ty::OutlivesPredicate(param_ty, region_bound); let outlives = ty::OutlivesPredicate(param_ty, region_bound);
(ty::Binder::dummy(outlives).to_predicate(tcx), span) (ty::Binder::bind(outlives).to_predicate(tcx), span)
}) })
.chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| { .chain(self.trait_bounds.iter().map(|&(bound_trait_ref, span, constness)| {
let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx); let predicate = bound_trait_ref.with_constness(constness).to_predicate(tcx);