Make thir_check_unsafety itself responsible for checking gate

This commit is contained in:
LeSeulArtichaut 2021-05-24 15:09:33 +02:00
parent 13e7b237fd
commit af3d9a3aa3
3 changed files with 14 additions and 12 deletions

View file

@ -873,9 +873,8 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
sess.time("MIR_effect_checking", || {
for def_id in tcx.body_owners() {
if tcx.sess.opts.debugging_opts.thir_unsafeck {
tcx.ensure().thir_check_unsafety(def_id);
} else {
tcx.ensure().thir_check_unsafety(def_id);
if !tcx.sess.opts.debugging_opts.thir_unsafeck {
mir::transform::check_unsafety::check_unsafety(tcx, def_id);
}