-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Compiler Warnings 2018-07-30 #2982
Comments
I guess these warnings are caused by this PR: rust-lang/rust#52681 https://github.com/rust-lang/rust/pull/52681/files#diff-5b4d01d26caf43976125ba0f877e78c0R337 |
Hmm, i would have expected at least some of these cases to be allowed in NLL due to two-phase borrows... Update: Oh, no, i think I misread the code. two-phase borrows let you do an immutable borrow during an expression that evaluated for a method call's parameter, but the borrow has to end before the method itself gets around to executing. In the cases that I misidentified as being potentially allowed, I think you have immutable borrows that are lasting long enough to leak into the method call execution. |
(Still this case is interesting because I don't think I was aware of an AST-borrowck soundness bug of this form, and yet this seems to be one...) ((Or maybe the borrows here are of derefed data, and it doesn’t actually conflict with the |
I believe @pnkfelix that this could be rust-lang/rust#38899 |
When building Clippy the compiler now emits the warnings below:
I've already got a fix for the
unused_mut
error.Is this a compiler issue or are these warnings genuine? Shouldn't the borrow on the argument end before the method is called?
The text was updated successfully, but these errors were encountered: