Skip to content

Missing PlaceMention for scrutinee in #[loop_match] #144781

@bjorn3

Description

@bjorn3

I tried this code:

#![allow(incomplete_features)]
#![feature(loop_match)]

enum State {
    A,
}

fn main() {
    let mut state = State::A;
    #[loop_match]
    'a: loop {
        state = 'blk: {
            match state {
                State::A => {
                    #[const_continue]
                    break 'blk State::A;
                }
            }
        };
    }
}

I expected to see this happen: There is a PlaceMention for state.

Instead, this happened: There is no PlaceMention for state.

Meta

rustc --version --verbose:

1.90.0-nightly (2025-07-31 adcb3d3b4cd3b7c4cde6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.F-loop_matchwhen you match up with someone and they really throw you for a loop

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions