Skip to content

Commit 21ddf4d

Browse files
Ensure that drop_elaboration_and_check_consts runs for all const items
1 parent a43e486 commit 21ddf4d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc_interface/passes.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,11 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
847847

848848
sess.time("MIR_effect_checking", || {
849849
for def_id in tcx.body_owners() {
850-
mir::transform::check_unsafety::check_unsafety(tcx, def_id)
850+
mir::transform::check_unsafety::check_unsafety(tcx, def_id);
851+
852+
if tcx.hir().body_const_context(def_id).is_some() {
853+
tcx.ensure().mir_drops_elaborated_and_const_checked(def_id);
854+
}
851855
}
852856
});
853857

0 commit comments

Comments
 (0)