about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/errors.rs
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-07-29 20:19:53 +1000
committerGitHub <noreply@github.com>2025-07-29 20:19:53 +1000
commit15ddf9c7b3d2bd8b00de08cfebcf47c00081db03 (patch)
tree79dd252949182c7174977dd1f40cf1258eadd848 /compiler/rustc_mir_transform/src/errors.rs
parent03bb80c25453a58cec0b918c57402fe6e6372ea6 (diff)
parentaa9767290e46c9c73fa1fd3abb52277b4d07cfae (diff)
downloadrust-15ddf9c7b3d2bd8b00de08cfebcf47c00081db03.tar.gz
rust-15ddf9c7b3d2bd8b00de08cfebcf47c00081db03.zip
Rollup merge of #144609 - Muscraft:right-align, r=compiler-errors
feat: Right align line numbers

As part of my work on getting `annotate-snipptes` to be used as `rustc`'s renderer, I realized that `rustc` left-aligned line numbers, while `annotate-snippets` right-aligned them. This PR switches `rustc` to right-align the line numbers, matching `annotate-snippets`. In practice, this change isn't very noticeable in day-to-day output, as it only shows up when a diagnostic span contains line numbers with different lengths (9->10, 99->100, 999->1000, etc.).

`rustc`
```
error[E0412]: cannot find type `F` in this scope
  --> $DIR/ui-testing-optout.rs:92:10
   |
4  | type A = B;
   | ----------- similarly named type alias `A` defined here
...
92 | type E = F;
   |          ^ help: a type alias with a similar name exists: `A`
```
`annotate-snippets`
```
error[E0412]: cannot find type `F` in this scope
  --> $DIR/ui-testing-optout.rs:92:10
   |
 4 | type A = B;
   | ----------- similarly named type alias `A` defined here
...
92 | type E = F;
   |          ^ help: a type alias with a similar name exists: `A`
```

r? ``@compiler-errors``
Diffstat (limited to 'compiler/rustc_mir_transform/src/errors.rs')
0 files changed, 0 insertions, 0 deletions