Rollup merge of #87527 - LeSeulArtichaut:no-mir-unsafeck, r=oli-obk

Don't run MIR unsafeck at all when using `-Zthir-unsafeck`

I don't know how I missed this :D
r? ``@oli-obk``
This commit is contained in:
Yuki Okushi 2021-07-29 06:11:48 +09:00 committed by GitHub
commit 9e94d7bbe6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -259,11 +259,13 @@ fn mir_const<'tcx>(
}
// Unsafety check uses the raw mir, so make sure it is run.
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();