Skip to content

goto out of a for loop over a generator fails with a vague 'MIR lowering failed' instead of a diagnostic naming the goto (D69) #1730

Closed

Description

@ehartford

Spec: §13.4 (D69, push generators), §13.5b (goto), No Silent Fallbacks.

Found by the D69 implementation (branch gen-push-impl). A for x in g: over a generator lowers its body into a closure passed to Gen.each; break, continue, return, ? and labeled jumps are carried across that call, but a goto whose target is outside the loop is not. Compilation stops with a generic "MIR lowering failed" and no diagnostic naming the construct or its location.

Expected: either the goto is carried across the call like the other exits, or a loud diagnostic at the goto that names this issue. The current failure is loud but tells the user nothing about which statement or why.

Activity

  1. added 4 commits that reference this issue on Sep 27, 2026
    85bcc76
    0ba8b6f
    9e5f112
    9c7bc2c
  2. added a commit that references this issue on Sep 27, 2026
    f50c708
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions