Skip to content

Commit 71cd93a

Browse files
authored
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
2 parents 23d91e2 + 6d207f5 commit 71cd93a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/librustc_codegen_ssa/mir/analyze.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,8 @@ impl<'mir, 'a: 'mir, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
243243
}
244244

245245
PlaceContext::MutatingUse(MutatingUseContext::Drop) => {
246-
let ty = mir::Place::Base(mir::PlaceBase::Local(local)).ty(self.fx.mir,
247-
self.fx.cx.tcx());
248-
let ty = self.fx.monomorphize(&ty.ty);
246+
let ty = self.fx.mir.local_decls[local].ty;
247+
let ty = self.fx.monomorphize(&ty);
249248

250249
// Only need the place if we're actually dropping it.
251250
if self.fx.cx.type_needs_drop(ty) {

0 commit comments

Comments
 (0)