Skip to content
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

Chapter 18.2: Irrefutable Patterns Cause a Warning with "if let" and "while let" #3703

Closed
qualitysoftwareguy opened this issue Jul 15, 2023 · 0 comments · Fixed by #3704
Closed
Milestone

Comments

@qualitysoftwareguy
Copy link
Contributor

  • I have searched open and closed issues and pull requests for duplicates, using these search terms:
    " chapter 18.2"
    "irrefutable patterns"

  • I have checked the latest main branch to see if this has already been fixed, in this file:
    Yes

URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch18-02-refutability.html

Description of the problem:
The book currently states that using an irrefutable pattern with an "if let" will cause the compiler to give an error: "This code is perfectly valid, although it means we cannot use an irrefutable pattern without receiving an error." However, this behavior was changed (in rust-lang/rust#44495) so that a warning is now produced.

Suggested fix:
From the above sentence, change "will cause the compiler to give an error" to "will cause the compiler to give a warning".

qualitysoftwareguy added a commit to qualitysoftwareguy/rust-lang-book that referenced this issue Jul 15, 2023
@chriskrycho chriskrycho added this to the ch18 milestone Mar 29, 2024
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

Successfully merging a pull request may close this issue.

2 participants