Skip to content

Commit

Permalink
Get ty from local_decls instead of using Place
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed May 15, 2019
1 parent 7158ed9 commit 6d207f5
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 6d207f5

Please sign in to comment.