mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Equality of regions is not just on identity, but if both regions outlive each other
This commit is contained in:
parent
6f71cab3b0
commit
07b8bbb1f6
@ -637,7 +637,15 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
|
||||
.choice_regions
|
||||
.iter()
|
||||
.map(|&choice_region| var_data.normalize(self.tcx(), choice_region));
|
||||
if !choice_regions.clone().any(|choice_region| member_region == choice_region) {
|
||||
let fr = &self.region_rels.free_regions;
|
||||
let sub = |a, b| {
|
||||
fr.is_free_or_static(a)
|
||||
&& fr.is_free_or_static(b)
|
||||
&& fr.sub_free_regions(self.tcx(), a, b)
|
||||
};
|
||||
if !choice_regions.clone().any(|choice_region| {
|
||||
sub(member_region, choice_region) && sub(choice_region, member_region)
|
||||
}) {
|
||||
let span = self.tcx().def_span(member_constraint.opaque_type_def_id);
|
||||
errors.push(RegionResolutionError::MemberConstraintFailure {
|
||||
span,
|
||||
|
Loading…
Reference in New Issue
Block a user