Ensure that drop_elaboration_and_check_consts runs for all const items

This commit is contained in:
Dylan MacKenzie 2020-05-02 21:16:55 -07:00
parent a43e486e8d
commit 21ddf4d903

View file

@ -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);
}
}
});