Normalize regions before comparing them for member constraints

This commit is contained in:
Oli Scherer 2021-09-24 17:32:30 +00:00
parent 5115069ccd
commit 6f71cab3b0

View file

@ -297,8 +297,18 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
// Get an iterator over the *available choice* -- that is,
// each choice region `c` where `lb <= c` and `c <= ub` for all the
// upper bounds `ub`.
debug!("enforce_member_constraint: upper_bounds={:#?}", member_upper_bounds);
let mut options = member_constraint.choice_regions.iter().filter(|option| {
debug!("upper_bounds={:#?}", member_upper_bounds);
let mut options = member_constraint
.choice_regions
.iter()
.filter_map(|option| match option {
ty::ReVar(vid) => match var_values.value(*vid) {
VarValue::ErrorValue => None,
VarValue::Value(r) => Some(r),
},
r => Some(r),
})
.filter(|option| {
self.sub_concrete_regions(member_lower_bound, option)
&& member_upper_bounds
.iter()