-
Couldn't load subscription status.
- Fork 13.9k
When moving out of a for loop head, suggest borrowing it in nll mode #59429
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
Conversation
|
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
|
@bors r+ |
|
📌 Commit 4bad56e has been approved by |
…chenkov When moving out of a for loop head, suggest borrowing it in nll mode Follow up to rust-lang#59195 for NLL.
…chenkov When moving out of a for loop head, suggest borrowing it in nll mode Follow up to rust-lang#59195 for NLL.
…chenkov When moving out of a for loop head, suggest borrowing it in nll mode Follow up to rust-lang#59195 for NLL.
Rollup of 10 pull requests Successful merges: - #58717 (Add FromStr impl for NonZero types) - #59091 (Combine input and eval_always query types) - #59216 (Type dependent defs wrappers) - #59318 (rustc: Update linker flavor inference from filename) - #59320 (rustc: Allow using `clang` for wasm32 targets) - #59363 (#59361 Moved rustc edition opt to short list) - #59371 (ffi: rename VaList::copy to VaList::with_copy) - #59398 (Add a way to track Rustfix UI test coverage) - #59408 (compiletest: make path normalization smarter) - #59429 (When moving out of a for loop head, suggest borrowing it in nll mode) Failed merges: r? @ghost
| err.span_suggestion( | ||
| move_span, | ||
| "consider borrowing this to avoid moving it into the for loop", | ||
| format!("&{}", snippet), |
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.
Note that this will only work if &T implements IntoIterator-- can we check for this?
Follow up to #59195 for NLL.