-
Notifications
You must be signed in to change notification settings - Fork 7
Let statement with wildcard lead to warnings for unused variables #57
Comments
What's the state of this? Does this need to be fixed before we release Rust 2021? |
@roxelo how is this related to disjoint captures? Wouldn't the same warning occur either way? |
|
So I looked into this a bit. Basically the problem is that we should consider all local variables that get mentioned by the closure to be at least... read? That seems plausible. They may also be mutated/moved. Is the problem @roxelo that we are not taking "fake reads" into account? |
Yes, that's what Aman and I were thinking the issue was: https://rust-lang.zulipchat.com/#narrow/stream/189812-t-compiler.2Fwg-rfc-2229/topic/Lint.20warning.20inconsistencies/near/249786245. I'll try having a fix later tonight |
I remember this now 😅 We had purposely decided to do it at one point I think. Here is the relevant code https://github.com/rust-lang/rust/blob/master/compiler/rustc_passes/src/liveness.rs#L1243-L1249 |
@rustbot claim |
Error: This repository is not enabled to use triagebot. Please let |
There seem to be inconsistencies with lint warnings when using let statement with wildcards inside closures.
Note this same inconsistency takes place without type anotation.
The text was updated successfully, but these errors were encountered: