Skip to content

Reference paragraph mentions nonexistent example #28196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
frewsxcv opened this issue Sep 3, 2015 · 6 comments
Closed

Reference paragraph mentions nonexistent example #28196

frewsxcv opened this issue Sep 3, 2015 · 6 comments

Comments

@frewsxcv
Copy link
Member

frewsxcv commented Sep 3, 2015

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

@alexispurslane
Copy link
Contributor

Should we add an example, or remove the reference?

@frewsxcv
Copy link
Member Author

frewsxcv commented Sep 3, 2015

I don't have an answer to that question, but it's worth mentioning that 'Nil' and 'List' are used in examples later in the Reference

@steveklabnik
Copy link
Member

I would remove the reference.

@alexispurslane
Copy link
Contributor

⬆️ I created a pull request doing as you suggest, @steveklabnik.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Sep 4, 2015
@frewsxcv
Copy link
Member Author

Fixed in #28216

@frewsxcv
Copy link
Member Author

Thanks @ChristopherDumas

dlrobertson pushed a commit to dlrobertson/rust that referenced this issue Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants