-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Suggest adding a local for vector to fix borrowck errors #95807
Conversation
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Ideally instead of highlighting the expression that borrows, we could extend it to its usage, so instead of:
help: try adding a local
LL | vec[vec.len() - 1] = 123;
| ^^^^^^^^^
We could do:
help: try adding a local
LL | vec[vec.len() - 1] = 123;
| ^^^^^^^^^^^^^
But I don't think this is trivial.
@bors r+ |
📌 Commit 71fea61 has been approved by |
…r, r=fee1-dead Suggest adding a local for vector to fix borrowck errors closes rust-lang#95574
Rollup of 7 pull requests Successful merges: - rust-lang#95566 (Avoid duplication of doc comments in `std::char` constants and functions) - rust-lang#95784 (Suggest replacing `typeof(...)` with an actual type) - rust-lang#95807 (Suggest adding a local for vector to fix borrowck errors) - rust-lang#95849 (Check for git submodules in non-git source tree.) - rust-lang#95852 (Fix missing space in lossy provenance cast lint) - rust-lang#95857 (Allow multiple derefs to be splitted in deref_separator) - rust-lang#95868 (rustdoc: Reduce allocations in a `html::markdown` function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
closes #95574