Skip to content

Commit

Permalink
Ensure that drop_elaboration_and_check_consts runs for all const items
Browse files Browse the repository at this point in the history
  • Loading branch information
ecstatic-morse committed Jun 13, 2020
1 parent a43e486 commit 21ddf4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,11 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {

sess.time("MIR_effect_checking", || {
for def_id in tcx.body_owners() {
mir::transform::check_unsafety::check_unsafety(tcx, def_id)
mir::transform::check_unsafety::check_unsafety(tcx, def_id);

if tcx.hir().body_const_context(def_id).is_some() {
tcx.ensure().mir_drops_elaborated_and_const_checked(def_id);
}
}
});

Expand Down

0 comments on commit 21ddf4d

Please sign in to comment.