You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
monadic Result comprehension lowers Ok temps at the generic base type (aggregate rvalue missing destination struct type) #722
MIR facts: the annotated binding result is the instantiated type (ty=333, Result[i32,str]) but the comprehension's intermediate temps are ty=84 — the UNINSTANTIATED generic base — so codegen's enum aggregate (CodegenDispatch.w:3566) has no concrete destination struct. The Ok(2)/Ok(3) iterables are being checked without the binding annotation's expectation reaching them, leaving the Err side unbound. Same unbound-Err family as the e == Ok(5) comparison fix in this batch (peer expectation was missing there too); the comprehension desugar needs the target type threaded into its iterable checks.
Tracked with the other two remaining spec-lane Class-B regressions (ss10_5 Option.cloned surface, ss13_3 wrong-value assert) — all three are seed-green.
Fixed in 6410a26. Root cause confirmed as the expectation-free "self-determined" subject check in check_match_expr: comprehension lowerings whose clause iterable is a bare variant construction (for a in Ok(2) under Result[i32, str]) never bound Result's Err side, so temps lowered at the uninstantiated generic base and codegen had no destination struct. Fix mirrors the batch's e == Ok(5) peer rule — a for-comprehension-lowered match subject that is a bare variant construction is typed against the present carrier expectation; every other match subject stays self-determined (the match if ok: Some(7) else: None guard case is untouched). Verified: the 6-line repro prints ok; spec_ss13_6a passes; err_default_op_type_mismatch and the comprehension carrier-mismatch diagnostics still fire.
Activity
ehartford commentedon Jul 26, 2026
Fixed in 6410a26. Root cause confirmed as the expectation-free "self-determined" subject check in check_match_expr: comprehension lowerings whose clause iterable is a bare variant construction (
for a in Ok(2)underResult[i32, str]) never bound Result's Err side, so temps lowered at the uninstantiated generic base and codegen had no destination struct. Fix mirrors the batch'se == Ok(5)peer rule — a for-comprehension-lowered match subject that is a bare variant construction is typed against the present carrier expectation; every other match subject stays self-determined (thematch if ok: Some(7) else: Noneguard case is untouched). Verified: the 6-line repro prints ok; spec_ss13_6a passes; err_default_op_type_mismatch and the comprehension carrier-mismatch diagnostics still fire.D22: fix the three remaining spec-lane regressions (ss10_5, ss13_3, s…