-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #87958 - m-ou-se:closure-migration-multispan-suggesti…
…ons, r=estebank Closure migration multispan suggestions This changes the `rust_2021_incompatible_closure_captures` lint 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: ``` [...] help: add a dummy let to cause `a` to be fully captured | 5 ~ let _ = || { 6 + let _ = &a; 7 + dbg!(a.0); 8 + println!("1"); 9 + println!("2"); 10 + println!("3"); ... | [...] help: add a dummy let to cause `b` to be fully captured | 14 | let _ = || { let _ = &b; dbg!(b.0); }; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ [...] help: add a dummy let to cause `c` to be fully captured | 16 | let _ = || { let _ = &c; dbg!(c.0) }; | ~~~~~~~~~~~~~~~~~~~~~~~~~ ``` After: ``` [...] help: add a dummy let to cause `a` to be fully captured | 5 ~ let _ = || { 6 + let _ = &a; | [...] help: add a dummy let to cause `b` to be fully captured | 14 | let _ = || { let _ = &b; dbg!(b.0); }; | +++++++++++ [...] help: add a dummy let to cause `c` to be fully captured | 16 | let _ = || { let _ = &c; dbg!(c.0) }; | +++++++++++++ + ```
- Loading branch information
Showing
10 changed files
with
97 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.