diff options
| author | LeSeulArtichaut <leseulartichaut@gmail.com> | 2021-07-27 19:47:39 +0200 |
|---|---|---|
| committer | LeSeulArtichaut <leseulartichaut@gmail.com> | 2021-07-27 23:26:55 +0200 |
| commit | 40b57be5478935764ddfc45501169dbf921e939f (patch) | |
| tree | 5c7e0a5e444b6dea6fe10ffb6068f728f6ede9a8 | |
| parent | 3bc9dd0dd293ab82945e35888ed6d7ab802761ef (diff) | |
| download | rust-40b57be5478935764ddfc45501169dbf921e939f.tar.gz rust-40b57be5478935764ddfc45501169dbf921e939f.zip | |
Don't run MIR unsafeck at all when using `-Zthir-unsafeck`
| -rw-r--r-- | compiler/rustc_mir/src/transform/mod.rs | 10 |
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(); |
