Skip to content

Commit 399c5ca

Browse files
Rollup merge of #126723 - estebank:dot-dot-dot, r=Nadrieril
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 inconsistent with what we do in every other case *and* off-center.
2 parents 3ed2cd7 + 9fd7784 commit 399c5ca

18 files changed

+21
-21
lines changed

compiler/rustc_errors/src/emitter.rs

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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
|

tests/ui/let-else/let-else-if.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ help: try placing this code inside a block
88
|
99
LL ~ let Some(_) = Some(()) else { if true {
1010
LL |
11-
...
11+
...
1212
LL | return;
1313
LL ~ } };
1414
|

tests/ui/loops/loop-else-break-with-value.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched
2727
|
2828
LL ~ if let Some(1) = loop {
2929
LL |
30-
...
30+
...
3131
LL | return;
3232
LL ~ } { todo!() };
3333
|

tests/ui/moves/nested-loop-moved-value-wrong-continue.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ help: consider moving the expression out of the loop so it is only moved once
2626
LL ~ for foo in foos { let mut value = baz.push(foo);
2727
LL ~ for bar in &bars { if foo == *bar {
2828
LL |
29-
...
29+
...
3030
LL |
3131
LL ~ value;
3232
|
@@ -69,7 +69,7 @@ help: consider moving the expression out of the loop so it is only moved once
6969
LL ~ let mut value = baz.push(foo);
7070
LL ~ for bar in &bars {
7171
LL |
72-
...
72+
...
7373
LL | if foo == *bar {
7474
LL ~ value;
7575
|

tests/ui/parser/recover/recover-labeled-non-block-expr.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ help: consider enclosing expression in a block
5454
|
5555
LL ~ let _i = 'label: { match x {
5656
LL | 0 => 42,
57-
...
57+
...
5858
LL | _ => 1,
5959
LL ~ } };
6060
|

tests/ui/span/recursive-type-field.stderr

+1-1
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 ~ bar: Box<Bar<'a>>,
1919
LL | b: Rc<Bar<'a>>,
20-
...
20+
...
2121
LL | struct Bar<'a> {
2222
LL ~ y: (Box<Foo<'a>>, Box<Foo<'a>>),
2323
|

tests/ui/suggestions/issue-68049-2.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ help: consider changing this to be a mutable reference in the `impl` method and
1919
|
2020
LL ~ fn example(&mut self, input: &i32);
2121
LL | }
22-
...
22+
...
2323
LL | impl Hello for Test2 {
2424
LL ~ fn example(&mut self, input: &i32) {
2525
|

tests/ui/try-trait/try-operator-on-main.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ help: consider adding return type
1212
|
1313
LL ~ fn main() -> Result<(), Box<dyn std::error::Error>> {
1414
LL | // error for a `Try` type on a non-`Try` fn
15-
...
15+
...
1616
LL | try_trait_generic::<()>();
1717
LL +
1818
LL + Ok(())

tests/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ help: consider introducing a named lifetime parameter
1414
|
1515
LL ~ fn main<'a>() {
1616
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=&'a isize>,
17-
...
17+
...
1818
LL |
1919
LL ~ let _: dyn Foo(&'a isize, &'a usize) -> &'a usize;
2020
|

0 commit comments

Comments
 (0)