Skip to content

Commit e252b9b

Browse files
authored
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`
2 parents 3c29c95 + 40b57be commit e252b9b

File tree

1 file changed

+6
-4
lines changed
  • compiler/rustc_mir/src/transform

1 file changed

+6
-4
lines changed

compiler/rustc_mir/src/transform/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,12 @@ fn mir_const<'tcx>(
259259
}
260260

261261
// Unsafety check uses the raw mir, so make sure it is run.
262-
if let Some(param_did) = def.const_param_did {
263-
tcx.ensure().unsafety_check_result_for_const_arg((def.did, param_did));
264-
} else {
265-
tcx.ensure().unsafety_check_result(def.did);
262+
if !tcx.sess.opts.debugging_opts.thir_unsafeck {
263+
if let Some(param_did) = def.const_param_did {
264+
tcx.ensure().unsafety_check_result_for_const_arg((def.did, param_did));
265+
} else {
266+
tcx.ensure().unsafety_check_result(def.did);
267+
}
266268
}
267269

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

0 commit comments

Comments
 (0)