Skip to content

Allow tuples and other irrefutable patterns in parameter specifications #1398

Closed
@nikomatsakis

Description

@nikomatsakis

Currently we can write

for (a, b) in vec::zip(as, bs) { ... }

but not

vec::iter(vec::zip(as, bs)) { |(a, b)| ... }

nor

fn proc((a: A, b: B)) { ... }
vec::iter(vec::zip(as, bs), proc)

It would be nice to have these irrefutable patterns work in parameter specifications, if not in all functions then at least in Ruby-like blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions