-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Incorrect warning about value assigned to variable not being used #3796
Comments
How would this code be written in the latest syntax? I get |
Not critical for 0.6; de-milestoning |
Reproduced with 64963d6 -- updated test case:
This is borderline but I'll nominate it for milestone 5, production-ready. Warnings should be accurate. |
(bug triage) Revisited; reproduced with 0c6fc46. Nomination still stands. |
accepted for production-ready milestone |
Liveness is clearly not considered reads from closures correctly. |
I think I'm running into the same bug, but my test case is a bit simpler. When compiled, the code
produces the error message "bug.rs:2:12: 2:13 warning: value assigned to
compiles cleanly. Both programs produce binaries that run as expected. I am compiling with
|
@prsteele The warning is correct. You assigned 1 to a, which is never read. |
Assigning P-low. |
Closing, |
Compiling this code results in a warning: "test.rs:8:1: 8:2 warning: value assigned to
x
is never read", though since the variable has been captured by the lambda f() by reference, the assignment does have an effect when f() is invoked subsequently.Tested with git commit 07edf90
The text was updated successfully, but these errors were encountered: