We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Rust Playground
struct Foo { items: Vec<i32>, } fn main() { let Foo {items} = &Foo {items: vec![]}; items.push(12); }
This produces the error:
error[E0596]: cannot borrow immutable borrowed content `*items` as mutable --> src/main.rs:7:5 | 6 | let Foo {items} = &Foo {items: vec![]}; | ----- consider changing this to `items` 7 | items.push(12); | ^^^^^ cannot borrow as mutable
The suggestion "consider changing this to items" is pointless in that it won't solve the problem.
items
The text was updated successfully, but these errors were encountered:
This is a dupe, probably of #51244. It is definitely fixed in beta and nightly. (i believe the fix was in PR #52242.)
Sorry, something went wrong.
Thanks!
No branches or pull requests
Rust Playground
This produces the error:
The suggestion "consider changing this to
items
" is pointless in that it won't solve the problem.The text was updated successfully, but these errors were encountered: