Skip to content

Enum pattern whose constructor resolves to const should be rejected #28992

Closed
@sanxiyn

Description

@sanxiyn

I believe the following program should be rejected, but it is accepted (and panics) now.

const C: i32 = 0;
fn main() {
    if let C(..) = 0 {
        panic!();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an AST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions