Skip to content

IdentifierPattern's right-hand side Pattern cannot be an IdentifierPattern #439

Open
@Ekleog

Description

@Ekleog

https://github.com/rust-lang-nursery/reference/blob/master/src/patterns.md currently mentions that IdentifierPattern's right-hand side is a Pattern, which is allowed to be an IdentifierPattern.

However, the following code doesn't parse let x @ y @ () = (); println!("{:?} {:?}", x, y); (playground) due to pattern bindings not being allowed after the @.

As a consequence, I think the reference should be updated to mention that an IdentifierPattern's right-hand-side Pattern is not actually a full Pattern, but is instead not allowed to be another IdentifierPattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-patternsArea: PatternsC-bugIncorrect statements, terminology, or rendering issuesNew ContentMissing features or aspects of language not currently documented.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions