Skip to content

Commit e2efb6a

Browse files
committed
Check that universe can name other universe instead of equality
1 parent 78da436 commit e2efb6a

File tree

1 file changed

+5
-4
lines changed
  • compiler/rustc_infer/src/infer/lexical_region_resolve

1 file changed

+5
-4
lines changed

compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,12 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
215215
}
216216
VarValue::Value(cur_region) => {
217217
let lub = match *cur_region {
218-
// If the empty and placeholder regions are in the same universe,
219-
// then the LUB is the Placeholder region (which is the cur_region).
220-
// If they are not in the same universe, the LUB is the Static lifetime.
218+
// If this empty region is from a universe that can name the
219+
// placeholder universe, then the LUB is the Placeholder region
220+
// (which is the cur_region). Otherwise, the LUB is the Static
221+
// lifetime.
221222
RePlaceholder(placeholder)
222-
if a_universe != placeholder.universe =>
223+
if !a_universe.can_name(placeholder.universe) =>
223224
{
224225
self.tcx().lifetimes.re_static
225226
}

0 commit comments

Comments
 (0)