Commit Graph

17 Commits

Author SHA1 Message Date
Kivooeo 43725ed819 use let chains in ast, borrowck, codegen, const_eval 2025-07-28 06:08:48 +05:00
Esteban Küber cb82b79f02 Fix rustdoc test 2025-03-07 17:55:08 +00:00
Esteban Küber 72326bfe40 On long spans, trim the middle of them to make them fit in the terminal width
When encountering a single line span that is wider than the terminal, we keep context at the start and end of the span but otherwise remove the code from the middle. This is somewhat independent from whether the left and right margins of the output have been trimmed as well.

```
error[E0308]: mismatched types
  --> $DIR/long-span.rs:6:15
   |
LL | ... = [0, 0, 0, 0, ..., 0, 0];
   |       ^^^^^^^^^^^^^...^^^^^^^ expected `u8`, found `[{integer}; 1681]`
```

Address part of #137680 (missing handling of the long suggestion). Fix #125581.
2025-03-07 17:55:08 +00:00
Nicholas Nethercote 5fd503ab44 Add warn(unreachable_pub) to rustc_errors. 2024-08-27 12:03:37 +10:00
Maybe Waffle f1d273cbfb Replace some _ == _ || _ == _s with matches!(_, _ | _)s 2023-01-30 12:26:26 +00:00
Yuri Astrakhan 7e8201ae0a Spellchecking some comments
This PR attempts to clean up some minor spelling mistakes in comments
2022-03-30 01:39:38 -04:00
klensy 8ebd811b32 review 2021-04-24 22:37:42 +03:00
klensy cb2d52282f rename StyledBuffer.text to lines 2021-04-16 05:38:32 +03:00
klensy 247d74f207 StyledBuffer::set_style: check overwrite first 2021-04-16 05:23:40 +03:00
klensy 7e9d3c6f6c StyledBuffer::prepend: if line is empty, insert content without inserting spaces 2021-04-16 05:11:45 +03:00
klensy e97ddedac6 added some docs for StyledBuffer 2021-04-16 04:14:59 +03:00
klensy f5229916e3 added default for StyledChar 2021-04-16 03:20:07 +03:00
klensy 756be4a052 refactored StyledBuffer parts into StyledChar 2021-04-16 03:14:05 +03:00
Josh Stone 72ebebe474 Use iter::zip in compiler/ 2021-03-26 09:32:31 -07:00
J. Ryan Stinnett 18f6cc6c5d Reduce tab formatting assertions to debug only
The tab replacement for diagnostics added in #79757 included a few assertions to
ensure all tab characters are handled appropriately. We've started getting
reports of these assertions firing (#81614). Since it's only a cosmetic issue,
this downgrades the assertions to debug only, so we at least continue compiling
even if the diagnostics might be a tad wonky.

Fixes #81614
2021-02-03 17:17:15 +00:00
J. Ryan Stinnett 3537bd80ff Replace tabs earlier in diagnostics
This replaces tabs earlier in the diagnostics emitting process, which allows
various margin calculations to ignore the existence of tabs. It does add a
string copy for the source lines that are emitted.
2020-12-09 10:12:15 +00:00
mark 9e5f7d5631 mv compiler to compiler/ 2020-08-30 18:45:07 +03:00