Skip to content

Commit

Permalink
Rollup merge of rust-lang#60862 - spastorino:get-ty-from-local_decls,…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Centril authored May 17, 2019
2 parents 23d91e2 + 6d207f5 commit 71cd93a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/librustc_codegen_ssa/mir/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 71cd93a

Please sign in to comment.