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
This commit is contained in:
Mazdak Farrokhzad 2019-05-17 02:54:16 +02:00 committed by GitHub
commit 71cd93a104
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {