-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Borrow checker reports multiple mutable borrows when there's only one #9068
Comments
I thought I'd seen an issue for this so far, it forget where it went though. I also have this pattern a fair amount, and it's be awesome to be able to work. The workaround I've always used is to have a break/return in the |
Def a dup of #6393. I propose either closing the bug or repurposing it to be a request for |
I ran into this issue with:
Workaround:
|
|
Triage: this bug is very old, and so I'm not sure it's really actionable. As the above comments state, it's a dup of #6393, and possibly with a mixture of collection methods that no longer exist. Therefore, I'm giving it a close. |
…fate,xFrednet fix typo in Clippy Lints page https://rust-lang.github.io/rust-clippy/master/#significant_drop_in_scrutinee changelog: none
Perhaps I'm going about it wrong, but I would hope that the following code would compile:
The error message:
It would be nice if the borrow checker knew that in the
None
branch, there was no longer a reference toself
arising from the call tofind_mut
, so at the call toinsert
, there are no other mutable borrows ofself
. Naively, I'd think this would fall under flow-sensitivity, but maybe not?/cc @nikomatsakis
The text was updated successfully, but these errors were encountered: