rust/compiler/rustc_errors/src
Dylan DPC 74aa55b3fc
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
..
json Use serde_json for json error messages 2022-06-03 16:46:19 +00:00
annotate_snippet_emitter_writer.rs Support lint expectations for --force-warn lints (RFC 2383) 2022-06-16 08:16:43 +02:00
diagnostic.rs Rollup merge of #97757 - xFrednet:rfc-2383-expect-with-force-warn, r=wesleywiser,flip1995 2022-06-16 09:10:20 +02:00
diagnostic_builder.rs errors: simplify referring to fluent attributes 2022-05-30 13:38:19 +01:00
emitter.rs Add back MAX_SUGGESTION_HIGHLIGHT_LINES so clippy is happy & buildable 2022-06-16 17:08:26 +04:00
json.rs Support lint expectations for --force-warn lints (RFC 2383) 2022-06-16 08:16:43 +02:00
lib.rs 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
lock.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
registry.rs Remove (lots of) dead code 2021-03-27 22:16:33 -04:00
snippet.rs Compute most of Public/Exported access level in rustc_resolve 2022-01-09 21:33:14 +00:00
styled_buffer.rs Spellchecking some comments 2022-03-30 01:39:38 -04:00