Skip to content

Commit

Permalink
Check that universe can name other universe instead of equality
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Aug 25, 2023
1 parent 78da436 commit e2efb6a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,12 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
}
VarValue::Value(cur_region) => {
let lub = match *cur_region {
// If the empty and placeholder regions are in the same universe,
// then the LUB is the Placeholder region (which is the cur_region).
// If they are not in the same universe, the LUB is the Static lifetime.
// If this empty region is from a universe that can name the
// placeholder universe, then the LUB is the Placeholder region
// (which is the cur_region). Otherwise, the LUB is the Static
// lifetime.
RePlaceholder(placeholder)
if a_universe != placeholder.universe =>
if !a_universe.can_name(placeholder.universe) =>
{
self.tcx().lifetimes.re_static
}
Expand Down

0 comments on commit e2efb6a

Please sign in to comment.