Skip to content

[i, j] is considered a refutable pattern for [int, ..2] #14256

Closed
@kmcallister

Description

@kmcallister
let f: |[int, ..2]| -> int = |[i, j]| i+j;

produces

foo.rs:2:35: 2:41 error: refutable pattern in function argument
foo.rs:2     let f: |[int, ..2]| -> int = |[i, j]| i+j;
                                           ^~~~~~

But

for [i, j] in Some([1,2]).move_iter() {}

is fine.

rustc 0.11.0-pre (fbd8f4a 2014-05-15 08:36:50 -0700)
host: x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions