Skip to content

Commit 53e7393

Browse files
committed
Tweak tcx usage in lub_concrete_regions().
Some places use the local `tcx` variable, some use `self.tcx()`. This commit removes the local variable so that all places use `self.tcx()`, for consistency.
1 parent 20cc752 commit 53e7393

File tree

1 file changed

+3
-5
lines changed
  • src/librustc/infer/lexical_region_resolve

1 file changed

+3
-5
lines changed

src/librustc/infer/lexical_region_resolve/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,6 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
407407

408408
/// Returns the smallest region `c` such that `a <= c` and `b <= c`.
409409
fn lub_concrete_regions(&self, a: Region<'tcx>, b: Region<'tcx>) -> Region<'tcx> {
410-
let tcx = self.tcx();
411-
412410
match (a, b) {
413411
(&ty::ReClosureBound(..), _)
414412
| (_, &ty::ReClosureBound(..))
@@ -468,15 +466,15 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
468466

469467
// otherwise, we don't know what the free region is,
470468
// so we must conservatively say the LUB is static:
471-
tcx.lifetimes.re_static
469+
self.tcx().lifetimes.re_static
472470
}
473471

474472
(&ReScope(a_id), &ReScope(b_id)) => {
475473
// The region corresponding to an outer block is a
476474
// subtype of the region corresponding to an inner
477475
// block.
478476
let lub = self.region_rels.region_scope_tree.nearest_common_ancestor(a_id, b_id);
479-
tcx.mk_region(ReScope(lub))
477+
self.tcx().mk_region(ReScope(lub))
480478
}
481479

482480
(&ReEarlyBound(_), &ReEarlyBound(_))
@@ -490,7 +488,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
490488
if a == b {
491489
a
492490
} else {
493-
tcx.lifetimes.re_static
491+
self.tcx().lifetimes.re_static
494492
}
495493
}
496494
}

0 commit comments

Comments
 (0)