We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
e.g. this variant of the test run-pass/issue-16671.rs
run-pass/issue-16671.rs
fn foo<F: FnOnce()>(_f: F) { } fn main() { let mut var = 0; foo(move|| { &mut var; }); }
Causes this error:
error[E0596]: cannot borrow immutable item `var` as mutable (Mir) --> ../src/test/run-pass/issue-16671.rs:18:9 | 18 | &mut var; | ^^^^^^^^ cannot borrow as mutable | = note: Value not mutable causing this error: `_` error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
Auto merge of #46236 - davidtwco:issue-46023, r=arielb1
e3ed212
MIR-borrowck: immutable unique closure upvars can be mutated Fixes #46023 and #46160 (see [this comment](#46236 (comment))).
Can be closed now, @arielb1 with #46236 merged?
Sorry, something went wrong.
Looks like it.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
e.g. this variant of the test
run-pass/issue-16671.rs
Causes this error:
The text was updated successfully, but these errors were encountered: