Skip to content

[ .. a] pattern breaks matches #6909

Closed
Closed
@huonw

Description

@huonw

This should print ok, but prints not ok.

fn main() {
    println(match &[1] {
        [2, .. _] => "not ok",
        [.. _]  => "ok"
    });
}

The problem seems to be the [.. _] pattern, since if this is replaced by _ or a, it prints ok. It also prints ok when matching on an empty vector. (The use of _ is not important.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions