Skip to content

Commit 5808d42

Browse files
committed
w
1 parent 89956e4 commit 5808d42

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_mir_transform/src/elaborate_drops.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ impl<'tcx> crate::MirPass<'tcx> for ElaborateDrops {
5454
#[instrument(level = "trace", skip(self, tcx, body))]
5555
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
5656
debug!("elaborate_drops({:?} @ {:?})", body.source, body.span);
57-
58-
let def_id = body.source.def_id();
59-
let typing_env = ty::TypingEnv::post_analysis(tcx, def_id);
57+
let typing_env = body.typing_env(tcx);
6058
// For types that do not need dropping, the behaviour is trivial. So we only need to track
6159
// init/uninit for types that do need dropping.
6260
let move_data = MoveData::gather_moves(body, tcx, |ty| ty.needs_drop(tcx, typing_env));

0 commit comments

Comments
 (0)