]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #87953 - m-ou-se:closure-migration-multiline-formatting, r=petrochenkov
authorManish Goregaokar <manishsmail@gmail.com>
Thu, 12 Aug 2021 17:04:15 +0000 (10:04 -0700)
committerGitHub <noreply@github.com>
Thu, 12 Aug 2021 17:04:15 +0000 (10:04 -0700)
commit0c4e37ad5cd9bb510a2480edb9d45456b4cc092b
treeaf31599564d3ebeb129e415ccbc540e8634ce9f6
parent692833a28fd7c2ddd870ef84c4b93ae2584275ee
parent31fcc94753dec7506d3395af82c82785a86ebce8
Rollup merge of #87953 - m-ou-se:closure-migration-multiline-formatting, r=petrochenkov

Improve formatting of closure capture migration suggestion for multi-line closures.

Fixes https://github.com/rust-lang/rust/issues/87952

Before:
```
help: add a dummy let to cause `a` to be fully captured
  |
5 ~     let _ = || { let _ = &a;
6 +         dbg!(a.0);
7 ~     };
  |
```

After:
```
help: add a dummy let to cause `a` to be fully captured
  |
5 ~     let _ = || {
6 +         let _ = &a;
7 +         dbg!(a.0);
8 ~     };
  |
```