Skip to content

ICE when const-evaling a block that does not end with an expression #31384

Closed
@scurest

Description

@scurest

Unreachable code is entered when trying to const-eval a block that doesn't have a terminating expression.

const fn f(_: ()) -> usize { 1 }
fn main() {
    [0; f({})];
}

The relevant line is

None => unreachable!(),

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions