From 28347ebdb3946b4298629bbaca72318ef890e04b Mon Sep 17 00:00:00 2001 From: LingMan Date: Fri, 12 Feb 2021 14:08:14 +0100 Subject: [PATCH] Drop an unnecessary intermediate variable Neither does it shorten the code nor does it provide a helpful name. --- compiler/rustc_typeck/src/check/upvar.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_typeck/src/check/upvar.rs index 04a9e65e664..411f3bbbf63 100644 --- a/compiler/rustc_typeck/src/check/upvar.rs +++ b/compiler/rustc_typeck/src/check/upvar.rs @@ -260,8 +260,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // local crate or were inlined into it along with some function. // This may change if abstract return types of some sort are // implemented. - let tcx = self.tcx; - self.typeck_results .borrow() .closure_min_captures_flattened(closure_id) @@ -276,7 +274,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { match capture { ty::UpvarCapture::ByValue(_) => upvar_ty, - ty::UpvarCapture::ByRef(borrow) => tcx.mk_ref( + ty::UpvarCapture::ByRef(borrow) => self.tcx.mk_ref( borrow.region, ty::TypeAndMut { ty: upvar_ty, mutbl: borrow.kind.to_mutbl_lossy() }, ),