about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-07-29 06:11:48 +0900
committerGitHub <noreply@github.com>2021-07-29 06:11:48 +0900
commit9e94d7bbe64679ec6815d23b484b3efbedf2d90a (patch)
treea59d6522bb7fb7e99dd6305277c835286ce3a57a
parent1d5f15f9fb4b7bba8b93014e0e49e52e5c5232c0 (diff)
parent40b57be5478935764ddfc45501169dbf921e939f (diff)
downloadrust-9e94d7bbe64679ec6815d23b484b3efbedf2d90a.tar.gz
rust-9e94d7bbe64679ec6815d23b484b3efbedf2d90a.zip
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``
-rw-r--r--compiler/rustc_mir/src/transform/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/rustc_mir/src/transform/mod.rs b/compiler/rustc_mir/src/transform/mod.rs
index 3fbc81d5426..e58a7d90308 100644
--- a/compiler/rustc_mir/src/transform/mod.rs
+++ b/compiler/rustc_mir/src/transform/mod.rs
@@ -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();