-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
Writing a while-let loop for e. g. an event loop triggers a compiler warning:
warning: irrefutable while-let pattern
--> src/main.rs:34:5
|
34 | / while let e = crossterm::event::read()? {
35 | | // code
36 | | }
| |_____^
|
= note: `#[warn(irrefutable_let_patterns)]` on by default
There's no error code, and no further information, so it isn't the easiest to investigate as a user.
In my case, I believe it's warning about potentially running an unintentionally infinite/indefinite loop, which in my case is intentional. So my guess would be that I am OK to #[allow] it - at a guess.
I would suggest that additional notes be added to this warning detailing why it's a potential problem
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.