Closure migration multispan suggestions#87958
Conversation
|
r? @cjgillot (rust-highfive has picked a reviewer for you, use r? to override) |
|
☔ The latest upstream changes (presumably #87980) made this pull request unmergeable. Please resolve the merge conflicts. |
02772dd to
6431097
Compare
|
r? @estebank |
estebank
left a comment
There was a problem hiding this comment.
I feel it would be slightly easier to read if we had a single multpart_suggestion call and the branching logic got you the messages, applicability and necessary vector, but I'm not too bothered either way.
r=me with or without the suggested changes.
|
I prefer calling it multiple times to avoid having to chase variables around, and to make it easier to make modifications to one of those cases later. E.g. using the @bors r=estebank |
|
📌 Commit 6431097 has been approved by |
Rollup of 10 pull requests Successful merges: - rust-lang#87178 ([rustdoc] Copy only item path to clipboard rather than full `use` statement.) - rust-lang#87677 (Adding explicit notice of lack of documentation for Tier 2 Platforms) - rust-lang#87958 (Closure migration multispan suggestions) - rust-lang#87967 (Detect fake spans in non_fmt_panic lint.) - rust-lang#88011 (Enable `--all-targets` for `x.py check` unconditionally) - rust-lang#88030 (Assign FIXMEs to me and remove obsolete ones) - rust-lang#88052 (Update redox_syscall) - rust-lang#88055 (Update RELEASES.md for 1.55.0) - rust-lang#88080 (Skip assert ICE with default_method_body_is_const) - rust-lang#88089 (Rustdoc font test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This changes the
rust_2021_incompatible_closure_captureslint to only suggest inserting the parts that need to be inserted, instead of suggesting to replace the entire closure by an almost identical closure with one statement added.Before:
After: