1
Fork 0

tolerate region vars in implied bounds

See https://github.com/rust-lang/rust/issues/109628.
This commit is contained in:
Ali MJ Al-Nasrawy 2023-03-26 14:37:24 +03:00
parent b20aa97d48
commit 2a3177a8bc
2 changed files with 28 additions and 1 deletions

View file

@ -142,7 +142,10 @@ impl<'tcx> OutlivesEnvironmentBuilder<'tcx> {
ty::ReStatic | ty::ReEarlyBound(_) | ty::ReFree(_),
) => self.region_relation.add(r_a, r_b),
(ty::ReError(_), _) | (_, ty::ReError(_)) => {}
_ => bug!("add_outlives_bounds: unexpected regions"),
// FIXME(#109628): We shouldn't have existential variables in implied bounds.
// Panic here once the linked issue is resolved!
(ty::ReVar(_), _) | (_, ty::ReVar(_)) => {}
_ => bug!("add_outlives_bounds: unexpected regions: ({r_a:?}, {r_b:?})"),
},
}
}