rust-clippy/tests/ui/branches_sharing_code
Dylan DPC 51e2d6a4a9 Rollup merge of #97798 - WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank
Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown

This is an attempt to fix suggestions one part of which is 6 lines or more far from the first. I've noticed "the problem" (of not showing some parts of the suggestion) here: https://github.com/rust-lang/rust/pull/97759#discussion_r889689230.

I'm not sure about the implementation (this big closure is just bad and makes already complicated code even more so), but I want to at least discuss the result.

Here is an example of how this changes the output:

Before:
```text
help: consider enclosing expression in a block
  |
3 ~     'l: { match () { () => break 'l,
4 |
5 |
6 |
7 |
8 |
...
```

After:
```text
help: consider enclosing expression in a block
  |
3 ~     'l: { match () { () => break 'l,
4 |
...
31|
32~ } };
  |
```

r? `@estebank`
`@rustbot` label +A-diagnostics +A-suggestion-diagnostics
2022-06-17 12:21:48 +02:00
..
false_positives.rs Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup 2022-06-16 17:39:06 +02:00
shared_at_bottom.rs Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup 2021-10-07 11:21:30 +02:00
shared_at_bottom.stderr Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup 2022-06-16 17:39:06 +02:00
shared_at_top.rs Merge 'rust-clippy/master' into clippyup 2022-05-21 13:24:00 +02:00
shared_at_top.stderr Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup 2022-06-16 17:39:06 +02:00
shared_at_top_and_bottom.rs Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup 2021-04-08 17:50:13 +02:00
shared_at_top_and_bottom.stderr Rollup merge of #97798 - WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank 2022-06-17 12:21:48 +02:00
valid_if_blocks.rs Merge 'rust-clippy/master' into clippyup 2022-05-21 13:24:00 +02:00
valid_if_blocks.stderr Merge commit 'b40ea209e7f14c8193ddfc98143967b6a2f4f5c9' into clippyup 2021-04-08 17:50:13 +02:00