Skip to content

Commit d84cff7

Browse files
committed
Tweak output
1 parent 7f66914 commit d84cff7

File tree

4 files changed

+20
-24
lines changed

4 files changed

+20
-24
lines changed

compiler/rustc_errors/src/emitter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,7 @@ impl FileWithAnnotatedLines {
22822282
}
22832283

22842284
// Find overlapping multiline annotations, put them at different depths
2285-
multiline_annotations.sort_by_key(|&(_, ref ml)| (ml.line_start, ml.line_end));
2285+
multiline_annotations.sort_by_key(|&(_, ref ml)| (ml.line_start, usize::MAX - ml.line_end));
22862286
for (_, ann) in multiline_annotations.clone() {
22872287
for (_, a) in multiline_annotations.iter_mut() {
22882288
// Move all other multiline annotations overlapping with this one

src/test/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ LL | fn oom(
1010
LL | || info: &Layout,
1111
LL | || ) -> ()
1212
| ||_______- arguments to this function are incorrect
13-
LL | | {
14-
LL | | loop {}
15-
LL | | }
16-
| |_^ expected `&Layout`, found struct `Layout`
13+
LL | | {
14+
LL | | loop {}
15+
LL | | }
16+
| |__^ expected `&Layout`, found struct `Layout`
1717
|
1818
note: function defined here
1919
--> $DIR/alloc-error-handler-bad-signature-1.rs:10:4
@@ -36,10 +36,10 @@ LL | fn oom(
3636
LL | || info: &Layout,
3737
LL | || ) -> ()
3838
| ||_______^ expected `!`, found `()`
39-
LL | | {
40-
LL | | loop {}
41-
LL | | }
42-
| |_- expected `!` because of return type
39+
LL | | {
40+
LL | | loop {}
41+
LL | | }
42+
| |__- expected `!` because of return type
4343
|
4444
= note: expected type `!`
4545
found unit type `()`

src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr

+8-12
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ LL | fn oom(
99
| ||
1010
LL | || info: Layout,
1111
LL | || ) {
12-
| || -
13-
| ||_|
14-
| | arguments to this function are incorrect
15-
LL | | loop {}
16-
LL | | }
17-
| |_^ expected struct `Layout`, found struct `core::alloc::Layout`
12+
| ||_- arguments to this function are incorrect
13+
LL | | loop {}
14+
LL | | }
15+
| |__^ expected struct `Layout`, found struct `core::alloc::Layout`
1816
|
1917
= note: struct `core::alloc::Layout` and struct `Layout` have similar names, but are actually distinct types
2018
note: struct `core::alloc::Layout` is defined in crate `core`
@@ -47,12 +45,10 @@ LL | fn oom(
4745
| ||
4846
LL | || info: Layout,
4947
LL | || ) {
50-
| || ^
51-
| ||_|
52-
| | expected `!`, found `()`
53-
LL | | loop {}
54-
LL | | }
55-
| |_- expected `!` because of return type
48+
| ||_^ expected `!`, found `()`
49+
LL | | loop {}
50+
LL | | }
51+
| |__- expected `!` because of return type
5652
|
5753
= note: expected type `!`
5854
found unit type `()`

src/test/ui/suggestions/suggest-remove-refs-3.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ LL | for (i, _) in & & &
77
| ||
88
LL | || & &v
99
| ||___________- help: consider removing 5 leading `&`-references
10-
LL | | .iter()
11-
LL | | .enumerate() {
12-
| |____________________^ `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator
10+
LL | | .iter()
11+
LL | | .enumerate() {
12+
| |_____________________^ `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterator
1313
|
1414
= help: the trait `Iterator` is not implemented for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>`
1515
= note: required for `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` to implement `IntoIterator`

0 commit comments

Comments
 (0)