Skip to content

Commit

Permalink
Rollup merge of #87527 - LeSeulArtichaut:no-mir-unsafeck, r=oli-obk
Browse files Browse the repository at this point in the history
Don't run MIR unsafeck at all when using `-Zthir-unsafeck`

I don't know how I missed this :D
r? ``@oli-obk``
  • Loading branch information
JohnTitor authored Jul 28, 2021
2 parents 1d5f15f + 40b57be commit 9e94d7b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions compiler/rustc_mir/src/transform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,12 @@ fn mir_const<'tcx>(
}

// Unsafety check uses the raw mir, so make sure it is run.
if let Some(param_did) = def.const_param_did {
tcx.ensure().unsafety_check_result_for_const_arg((def.did, param_did));
} else {
tcx.ensure().unsafety_check_result(def.did);
if !tcx.sess.opts.debugging_opts.thir_unsafeck {
if let Some(param_did) = def.const_param_did {
tcx.ensure().unsafety_check_result_for_const_arg((def.did, param_did));
} else {
tcx.ensure().unsafety_check_result(def.did);
}
}

let mut body = tcx.mir_built(def).steal();
Expand Down

0 comments on commit 9e94d7b

Please sign in to comment.