From 1fc55c7a3492bb3bad4241c33e0625c1110c60c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Thu, 25 Jun 2026 15:27:24 +0200 Subject: [PATCH 1/2] comment about empty run_passes --- compiler/rustc_mir_transform/src/shim.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs index 6d9b8feea05f4..f4cfda9d50f66 100644 --- a/compiler/rustc_mir_transform/src/shim.rs +++ b/compiler/rustc_mir_transform/src/shim.rs @@ -1074,6 +1074,8 @@ pub(super) fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> { // so this would otherwise not get filled). body.set_mentioned_items(Vec::new()); + // We don't pass any passes here, just to force a phase change to `Optimized`. + // Otherwise this bit of MIR will trigger assertions trying to detect MIR with an invalid phase. pm::run_passes_no_validate( tcx, &mut body, From e176864ce54248b7f483f63bcdc48c16af779a5d Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 17 Jul 2026 09:49:11 +0200 Subject: [PATCH 2/2] fix grammar --- compiler/rustc_mir_transform/src/shim.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs index f4cfda9d50f66..9a75c7007cea3 100644 --- a/compiler/rustc_mir_transform/src/shim.rs +++ b/compiler/rustc_mir_transform/src/shim.rs @@ -1074,7 +1074,7 @@ pub(super) fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> { // so this would otherwise not get filled). body.set_mentioned_items(Vec::new()); - // We don't pass any passes here, just to force a phase change to `Optimized`. + // We don't pass any passes here, we just force a phase change to `Optimized`. // Otherwise this bit of MIR will trigger assertions trying to detect MIR with an invalid phase. pm::run_passes_no_validate( tcx,