Skip to content

Commit

Permalink
Rollup merge of #82031 - LingMan:unneeded_var, r=varkor
Browse files Browse the repository at this point in the history
Drop an unnecessary intermediate variable

Neither does it shorten the code nor does it provide a helpful name.

`@rustbot` modify labels +C-cleanup +T-compiler

r? `@varkor`
  • Loading branch information
JohnTitor authored Feb 13, 2021
2 parents 14b217c + 28347eb commit f6677b0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_typeck/src/check/upvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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() },
),
Expand Down

0 comments on commit f6677b0

Please sign in to comment.