Skip to content

Commit 9fd7784

Browse files
committed
Fix ... in multline code-skips in suggestions
When we have long code skips, we write `...` in the line number gutter. For suggestions, we were "centering" the `...` with the line, but that was consistent with what we do in every other case.
1 parent 3d5d7a2 commit 9fd7784

18 files changed

+21
-21
lines changed

compiler/rustc_errors/src/emitter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,7 @@ impl HumanEmitter {
19051905
//
19061906
// LL | this line was highlighted
19071907
// LL | this line is just for context
1908-
// ...
1908+
// ...
19091909
// LL | this line is just for context
19101910
// LL | this line was highlighted
19111911
_ => {
@@ -1926,7 +1926,7 @@ impl HumanEmitter {
19261926
)
19271927
}
19281928

1929-
buffer.puts(row_num, max_line_num_len - 1, "...", Style::LineNumber);
1929+
buffer.puts(row_num, 0, "...", Style::LineNumber);
19301930
row_num += 1;
19311931

19321932
if let Some((p, l)) = last_line {

src/tools/clippy/tests/ui/bind_instead_of_map_multipart.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ LL | }
6262
LL | match s.len() {
6363
LL ~ 10 => 2,
6464
LL | 20 => {
65-
...
65+
...
6666
LL | if foo() {
6767
LL ~ return 20;
6868
LL | }

src/tools/clippy/tests/ui/needless_collect_indirect.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ help: check if the original Iterator contains an element instead of collecting t
212212
|
213213
LL ~
214214
LL |
215-
...
215+
...
216216
LL | // Do lint
217217
LL ~ vec.iter().map(|k| k * k).any(|x| x == n);
218218
|

src/tools/clippy/tests/ui/needless_late_init.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ help: move the declaration `x` here
215215
|
216216
LL ~
217217
LL | // types that should be considered insignificant
218-
...
218+
...
219219
LL | let y = Box::new(4);
220220
LL ~ let x = SignificantDrop;
221221
|

src/tools/clippy/tests/ui/needless_return.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ help: remove `return`
518518
|
519519
LL ~ 10
520520
LL | },
521-
...
521+
...
522522
LL | },
523523
LL ~ }
524524
|

tests/ui/closures/2229_closure_analysis/migrations/auto_traits.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ help: add a dummy let to cause `fptr` to be fully captured
1717
|
1818
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
1919
LL |
20-
...
20+
...
2121
LL |
2222
LL ~ } }).join().unwrap();
2323
|
@@ -39,7 +39,7 @@ help: add a dummy let to cause `fptr` to be fully captured
3939
|
4040
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
4141
LL |
42-
...
42+
...
4343
LL |
4444
LL ~ } }).join().unwrap();
4545
|

tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ help: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
109109
|
110110
LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
111111
LL |
112-
...
112+
...
113113
LL |
114114
LL ~ } }).join().unwrap();
115115
|

tests/ui/imports/issue-59764.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ help: a macro with this name exists at the root of the crate
209209
|
210210
LL ~ issue_59764::{makro as foobar,
211211
LL |
212-
...
212+
...
213213
LL |
214214
LL ~ foo::{baz}
215215
|

tests/ui/issues/issue-22644.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ help: try comparing the cast value
6464
|
6565
LL ~ println!("{}", (a
6666
LL |
67-
...
67+
...
6868
LL |
6969
LL ~ usize)
7070
|

tests/ui/issues/issue-57271.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
1717
|
1818
LL ~ Array(Box<TypeSignature>),
1919
LL | TypeVariable(()),
20-
...
20+
...
2121
LL | Base(BaseType),
2222
LL ~ Object(Box<ObjectType>),
2323
|

0 commit comments

Comments
 (0)