Skip to content

Reference paragraph mentions nonexistent example #28196

Closed

Description

https://doc.rust-lang.org/nightly/reference.html#match-expressions

A pattern that's just an identifier, like Nil in the previous example, could either refer to an enum variant that's in scope, or bind a new variable. The compiler resolves this ambiguity by forbidding variable bindings that occur in match patterns from shadowing names of variants that are in scope. For example, wherever List is in scope, a match pattern would not be able to bind Nil as a new name.

Nil and List are not mentioned in the previous example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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