Skip to content

Commit f4db5f7

Browse files
committed
Tweak multispan rendering
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
1 parent f495cec commit f4db5f7

29 files changed

+38
-117
lines changed

tests/ui-toml/excessive_nesting/excessive_nesting.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ error: this block is too nested
6666
LL | if true {
6767
| _________________________^
6868
LL | | if true {
69-
LL | |
70-
LL | | }
69+
... |
7170
LL | | }
7271
| |_________________^
7372
|

tests/ui/async_yields_async.stderr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ error: an async construct yields a type which is itself awaitable
8080
LL | let _m = async || {
8181
| _______________________-
8282
LL | | println!("I'm bored");
83-
LL | | // Some more stuff
8483
... |
8584
LL | | CustomFutureType
8685
| | ^^^^^^^^^^^^^^^^

tests/ui/branches_sharing_code/shared_at_bottom.stderr

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ error: all if blocks contain the same code at the end
115115
--> tests/ui/branches_sharing_code/shared_at_bottom.rs:183:5
116116
|
117117
LL | / x << 2
118-
LL | |
119-
LL | |
118+
... |
120119
LL | | };
121120
| |_____^
122121
|
@@ -131,8 +130,7 @@ error: all if blocks contain the same code at the end
131130
--> tests/ui/branches_sharing_code/shared_at_bottom.rs:192:5
132131
|
133132
LL | / x * 4
134-
LL | |
135-
LL | |
133+
... |
136134
LL | | }
137135
| |_____^
138136
|

tests/ui/collapsible_else_if.stderr

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ LL | } else {
4343
| ____________^
4444
LL | | if y == "world" {
4545
LL | | println!("world")
46-
LL | | }
4746
... |
4847
LL | | }
4948
LL | | }
@@ -66,7 +65,6 @@ LL | } else {
6665
| ____________^
6766
LL | | if let Some(42) = Some(42) {
6867
LL | | println!("world")
69-
LL | | }
7068
... |
7169
LL | | }
7270
LL | | }
@@ -89,7 +87,6 @@ LL | } else {
8987
| ____________^
9088
LL | | if let Some(42) = Some(42) {
9189
LL | | println!("world")
92-
LL | | }
9390
... |
9491
LL | | }
9592
LL | | }
@@ -112,7 +109,6 @@ LL | } else {
112109
| ____________^
113110
LL | | if x == "hello" {
114111
LL | | println!("world")
115-
LL | | }
116112
... |
117113
LL | | }
118114
LL | | }
@@ -135,7 +131,6 @@ LL | } else {
135131
| ____________^
136132
LL | | if let Some(42) = Some(42) {
137133
LL | | println!("world")
138-
LL | | }
139134
... |
140135
LL | | }
141136
LL | | }

tests/ui/crashes/ice-360.stderr

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ error: this loop never actually loops
22
--> tests/ui/crashes/ice-360.rs:5:5
33
|
44
LL | / loop {
5-
LL | |
6-
LL | |
7-
LL | |
85
... |
96
LL | |
107
LL | | }
@@ -16,9 +13,6 @@ error: this loop could be written as a `while let` loop
1613
--> tests/ui/crashes/ice-360.rs:5:5
1714
|
1815
LL | / loop {
19-
LL | |
20-
LL | |
21-
LL | |
2216
... |
2317
LL | |
2418
LL | | }

tests/ui/crate_level_checks/no_std_swap.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ error: this looks like you are trying to swap `a` and `b`
22
--> tests/ui/crate_level_checks/no_std_swap.rs:12:5
33
|
44
LL | / a = b;
5-
LL | |
6-
LL | |
5+
... |
76
LL | | b = a;
87
| |_________^ help: try: `core::mem::swap(&mut a, &mut b)`
98
|

tests/ui/doc/unbalanced_ticks.stderr

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ error: backticks are unbalanced
33
|
44
LL | /// This is a doc comment with `unbalanced_tick marks and several words that
55
| _____^
6-
LL | |
7-
LL | | /// should be `encompassed_by` tick marks because they `contain_underscores`.
8-
LL | | /// Because of the initial `unbalanced_tick` pair, the error message is
6+
... |
97
LL | | /// very `confusing_and_misleading`.
108
| |____________________________________^
119
|

tests/ui/empty_line_after/doc_comments.stderr

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ error: empty lines after doc comment
9696
--> tests/ui/empty_line_after/doc_comments.rs:63:5
9797
|
9898
LL | / /// for OldA
99-
LL | | // struct OldA;
100-
LL | |
101-
LL | | /// Docs
102-
LL | | /// for OldB
99+
... |
103100
LL | | // struct OldB;
104101
LL | |
105102
| |_^

tests/ui/empty_line_after/outer_attribute.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ error: empty lines after outer attribute
103103
--> tests/ui/empty_line_after/outer_attribute.rs:64:1
104104
|
105105
LL | / #[allow(unused)]
106-
LL | |
107-
LL | | // This comment is isolated
106+
... |
108107
LL | |
109108
| |_^
110109
LL | pub fn isolated_comment() {}

tests/ui/enum_variants.stderr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ error: all variants have the same prefix: `c`
1313
LL | / enum Foo {
1414
LL | |
1515
LL | | cFoo,
16-
LL | |
1716
... |
1817
LL | | cBaz,
1918
LL | | }
@@ -45,7 +44,6 @@ error: all variants have the same prefix: `Food`
4544
LL | / enum Food {
4645
LL | |
4746
LL | | FoodGood,
48-
LL | |
4947
... |
5048
LL | |
5149
LL | | }

0 commit comments

Comments
 (0)