diff --git a/src/mir/phi_core/loop_phi.rs b/src/mir/phi_core/loop_phi.rs index 49087df7..47eca99a 100644 --- a/src/mir/phi_core/loop_phi.rs +++ b/src/mir/phi_core/loop_phi.rs @@ -170,11 +170,10 @@ pub fn prepare_loop_variables_with( let mut incomplete_phis: Vec = Vec::new(); for (var_name, &value_before) in current_vars.iter() { - // Skip pinned variables (internal compiler temporaries) - if var_name.starts_with("__pin$") { - // Pinned variables are materialized via entry-phi in loop body, skip here - continue; - } + // Phase 25.1b fix: Include pinned variables in loop header PHIs + // Previously pinned variables were skipped, causing "use of undefined value" + // errors when receivers were used after loops. Pinned variables need PHIs + // at both header and exit points to properly merge values across control flow. // Materialize the incoming value at preheader to satisfy UseBeforeDef constraints // even when `value_before` was defined in a different block (e.g., previous loop header).