Skip to content

ICEs on #[loop_match] with constant evaluation #143310

Open
@CrazyboyQCD

Description

@CrazyboyQCD

Basic Code

#![feature(loop_match)]

#[unsafe(no_mangle)]
pub fn break_on_constant_evalution() -> i32 {
    let mut state = 0;
    #[loop_match]
    'a : loop {
        state = 'blk: {
            match state {
                0 => {
                    break 'a;
                },
                _ => {
                    const A: i32 = 0;
                    #[const_continue]
                    break 'blk /* constant evaluation */;
                }
            }
        }
    }
    state
}

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 loopI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions