about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-05-17 02:54:16 +0200
committerGitHub <noreply@github.com>2019-05-17 02:54:16 +0200
commit71cd93a1044dcdb4b2a2ffd2ed5e0e5c601eb765 (patch)
tree29dbb162cef9c5b282c0d92527a2365078f3597d /src
parent23d91e272ba31a08832ce8cf83d74d96f5888a33 (diff)
parent6d207f53a4ea28151233a49f3f52fd051d0d6d21 (diff)
downloadrust-71cd93a1044dcdb4b2a2ffd2ed5e0e5c601eb765.tar.gz
rust-71cd93a1044dcdb4b2a2ffd2ed5e0e5c601eb765.zip
Rollup merge of #60862 - spastorino:get-ty-from-local_decls, r=oli-obk
Get ty from local_decls instead of using Place

r? @oli-obk This is from one of your review on Place 2.0
Diffstat (limited to 'src')
-rw-r--r--src/librustc_codegen_ssa/mir/analyze.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_codegen_ssa/mir/analyze.rs b/src/librustc_codegen_ssa/mir/analyze.rs
index 8021d4b11d0..06d7b6c78f1 100644
--- a/src/librustc_codegen_ssa/mir/analyze.rs
+++ b/src/librustc_codegen_ssa/mir/analyze.rs
@@ -243,9 +243,8 @@ impl<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
             }
 
             PlaceContext::MutatingUse(MutatingUseContext::Drop) => {
-                let ty = mir::Place::Base(mir::PlaceBase::Local(local)).ty(self.fx.mir,
-                                                                           self.fx.cx.tcx());
-                let ty = self.fx.monomorphize(&ty.ty);
+                let ty = self.fx.mir.local_decls[local].ty;
+                let ty = self.fx.monomorphize(&ty);
 
                 // Only need the place if we're actually dropping it.
                 if self.fx.cx.type_needs_drop(ty) {