Warn if no-op let _ = x
statement is used
#90524
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
This is related to #90465.
The problem is code as follows
or also
The
let _ = x
statement in both cases has no effect at all:x
into the closure. With the 2018 edition it is moved into the closure however.x
is not even initialized.As the statement generally has no effect, it would be good to warn if it used like in the above cases. The author of the code probably intended something that the code is not actually doing.
The text was updated successfully, but these errors were encountered: