Commit 15ddf9c
authored
Rollup merge of rust-lang#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``File tree
6 files changed
+64
-54
lines changed- compiler
- rustc_errors/src
- rustc_parse/src/parser
- tests
- run-make/crate-loading-crate-depends-on-itself
- rustdoc-ui/doctest
- ui
- compiletest-self-test
- modules
6 files changed
+64
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
713 | 713 | | |
714 | 714 | | |
715 | 715 | | |
716 | | - | |
717 | | - | |
| 716 | + | |
718 | 717 | | |
719 | 718 | | |
720 | 719 | | |
| |||
2128 | 2127 | | |
2129 | 2128 | | |
2130 | 2129 | | |
2131 | | - | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
2132 | 2133 | | |
2133 | | - | |
2134 | | - | |
2135 | | - | |
| 2134 | + | |
2136 | 2135 | | |
2137 | 2136 | | |
2138 | 2137 | | |
| |||
2612 | 2611 | | |
2613 | 2612 | | |
2614 | 2613 | | |
2615 | | - | |
2616 | | - | |
2617 | | - | |
2618 | | - | |
2619 | | - | |
2620 | | - | |
| 2614 | + | |
2621 | 2615 | | |
2622 | 2616 | | |
2623 | 2617 | | |
| |||
2634 | 2628 | | |
2635 | 2629 | | |
2636 | 2630 | | |
2637 | | - | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
2638 | 2634 | | |
2639 | | - | |
2640 | | - | |
2641 | | - | |
| 2635 | + | |
2642 | 2636 | | |
2643 | 2637 | | |
2644 | 2638 | | |
| |||
2661 | 2655 | | |
2662 | 2656 | | |
2663 | 2657 | | |
2664 | | - | |
| 2658 | + | |
2665 | 2659 | | |
2666 | 2660 | | |
2667 | 2661 | | |
| |||
2671 | 2665 | | |
2672 | 2666 | | |
2673 | 2667 | | |
2674 | | - | |
| 2668 | + | |
2675 | 2669 | | |
2676 | 2670 | | |
2677 | 2671 | | |
| |||
2702 | 2696 | | |
2703 | 2697 | | |
2704 | 2698 | | |
2705 | | - | |
| 2699 | + | |
2706 | 2700 | | |
2707 | 2701 | | |
2708 | 2702 | | |
2709 | | - | |
| 2703 | + | |
2710 | 2704 | | |
2711 | 2705 | | |
2712 | 2706 | | |
| |||
3016 | 3010 | | |
3017 | 3011 | | |
3018 | 3012 | | |
| 3013 | + | |
| 3014 | + | |
| 3015 | + | |
| 3016 | + | |
| 3017 | + | |
| 3018 | + | |
| 3019 | + | |
| 3020 | + | |
| 3021 | + | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
3019 | 3029 | | |
3020 | 3030 | | |
3021 | 3031 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2114 | 2114 | | |
2115 | 2115 | | |
2116 | 2116 | | |
2117 | | - | |
| 2117 | + | |
2118 | 2118 | | |
2119 | | - | |
| 2119 | + | |
2120 | 2120 | | |
2121 | 2121 | | |
2122 | 2122 | | |
2123 | | - | |
2124 | | - | |
2125 | | - | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
2126 | 2126 | | |
2127 | 2127 | | |
2128 | 2128 | | |
| |||
2133 | 2133 | | |
2134 | 2134 | | |
2135 | 2135 | | |
2136 | | - | |
| 2136 | + | |
2137 | 2137 | | |
2138 | | - | |
| 2138 | + | |
2139 | 2139 | | |
2140 | 2140 | | |
2141 | 2141 | | |
2142 | | - | |
2143 | | - | |
2144 | | - | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
2145 | 2145 | | |
2146 | 2146 | | |
2147 | 2147 | | |
| |||
2189 | 2189 | | |
2190 | 2190 | | |
2191 | 2191 | | |
2192 | | - | |
| 2192 | + | |
2193 | 2193 | | |
2194 | | - | |
2195 | | - | |
2196 | | - | |
2197 | | - | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
2198 | 2198 | | |
2199 | | - | |
2200 | | - | |
| 2199 | + | |
| 2200 | + | |
2201 | 2201 | | |
2202 | 2202 | | |
2203 | 2203 | | |
| |||
2211 | 2211 | | |
2212 | 2212 | | |
2213 | 2213 | | |
2214 | | - | |
| 2214 | + | |
2215 | 2215 | | |
2216 | | - | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
2220 | 2220 | | |
2221 | | - | |
2222 | | - | |
| 2221 | + | |
| 2222 | + | |
2223 | 2223 | | |
2224 | 2224 | | |
2225 | 2225 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments