Skip to content

Commit

Permalink
Rollup merge of rust-lang#98795 - jackh726:lexical_region_resolve_cle…
Browse files Browse the repository at this point in the history
…anup, r=compiler-errors

A few cleanups

Each commit is (mostly) self-explanatory. These changes have come as I try to remove `ReEmpty` (rust-lang#98559).
  • Loading branch information
Dylan-DPC committed Jul 8, 2022
2 parents 1da9c94 + 31e1a77 commit 897062f
Show file tree
Hide file tree
Showing 11 changed files with 585 additions and 599 deletions.
18 changes: 7 additions & 11 deletions compiler/rustc_borrowck/src/region_infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
}
}

NllRegionVariableOrigin::RootEmptyRegion
| NllRegionVariableOrigin::Existential { .. } => {
NllRegionVariableOrigin::Existential { .. } => {
// For existential, regions, nothing to do.
}
}
Expand Down Expand Up @@ -1410,8 +1409,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
self.check_bound_universal_region(fr, placeholder, errors_buffer);
}

NllRegionVariableOrigin::RootEmptyRegion
| NllRegionVariableOrigin::Existential { .. } => {
NllRegionVariableOrigin::Existential { .. } => {
// nothing to check here
}
}
Expand Down Expand Up @@ -1513,8 +1511,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
self.check_bound_universal_region(fr, placeholder, errors_buffer);
}

NllRegionVariableOrigin::RootEmptyRegion
| NllRegionVariableOrigin::Existential { .. } => {
NllRegionVariableOrigin::Existential { .. } => {
// nothing to check here
}
}
Expand Down Expand Up @@ -1788,9 +1785,9 @@ impl<'tcx> RegionInferenceContext<'tcx> {
universe1.cannot_name(placeholder.universe)
}

NllRegionVariableOrigin::RootEmptyRegion
| NllRegionVariableOrigin::FreeRegion
| NllRegionVariableOrigin::Existential { .. } => false,
NllRegionVariableOrigin::FreeRegion | NllRegionVariableOrigin::Existential { .. } => {
false
}
}
}

Expand Down Expand Up @@ -2152,8 +2149,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
let blame_source = match from_region_origin {
NllRegionVariableOrigin::FreeRegion
| NllRegionVariableOrigin::Existential { from_forall: false } => true,
NllRegionVariableOrigin::RootEmptyRegion
| NllRegionVariableOrigin::Placeholder(_)
NllRegionVariableOrigin::Placeholder(_)
| NllRegionVariableOrigin::Existential { from_forall: true } => false,
};

Expand Down
Loading

0 comments on commit 897062f

Please sign in to comment.