Skip to content

Commit 012ff15

Browse files
author
Jonathan Turner
committed
Fix up some tidy-unfriendly spacing
1 parent 2f2c3e1 commit 012ff15

File tree

4 files changed

+29
-25
lines changed

4 files changed

+29
-25
lines changed

src/librustc_errors/emitter.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl EmitterWriter {
534534

535535
// Put in the spacer between the location and annotated source
536536
let buffer_msg_line_offset = buffer.num_lines();
537-
draw_col_separator(&mut buffer, buffer_msg_line_offset, max_line_num_len + 1);
537+
draw_col_separator_no_space(&mut buffer, buffer_msg_line_offset, max_line_num_len + 1);
538538

539539
// Next, output the annotate source for this file
540540
for line_idx in 0..annotated_file.lines.len() {
@@ -636,7 +636,7 @@ impl EmitterWriter {
636636
Ok(()) => {
637637
if !db.children.is_empty() {
638638
let mut buffer = StyledBuffer::new();
639-
draw_col_separator(&mut buffer, 0, max_line_num_len + 1);
639+
draw_col_separator_no_space(&mut buffer, 0, max_line_num_len + 1);
640640
match emit_to_destination(&buffer.render(), &db.level, &mut self.dst) {
641641
Ok(()) => (),
642642
Err(e) => panic!("failed to emit error: {}", e)
@@ -948,6 +948,10 @@ fn draw_col_separator(buffer: &mut StyledBuffer, line: usize, col: usize) {
948948
buffer.puts(line, col, "| ", Style::LineNumber);
949949
}
950950

951+
fn draw_col_separator_no_space(buffer: &mut StyledBuffer, line: usize, col: usize) {
952+
buffer.puts(line, col, "|", Style::LineNumber);
953+
}
954+
951955
fn draw_note_separator(buffer: &mut StyledBuffer, line: usize, col: usize) {
952956
buffer.puts(line, col, "= ", Style::LineNumber);
953957
}
@@ -1087,4 +1091,4 @@ impl Write for Destination {
10871091
Raw(ref mut w) => w.flush(),
10881092
}
10891093
}
1090-
}
1094+
}

src/libsyntax/codemap.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,7 @@ r"blork2.rs:2:1: 2:12
12651265
println!("r#\"\n{}\"#", str);
12661266
assert_eq!(str, &r#"
12671267
--> dummy.txt:11:1
1268-
|
1268+
|
12691269
11 | e-lä-vän
12701270
| ^
12711271
"#[1..]);
@@ -1333,7 +1333,7 @@ r"blork2.rs:2:1: 2:12
13331333

13341334
let expect_start = &r#"
13351335
--> dummy.txt:1:6
1336-
|
1336+
|
13371337
1 | _____aaaaaa____bbbbbb__cccccdd_
13381338
| ^^^^^^ ^^^^^^ ^^^^^^^
13391339
"#[1..];
@@ -1409,7 +1409,7 @@ r"blork2.rs:2:1: 2:12
14091409

14101410
let expect0 = &r#"
14111411
--> dummy.txt:5:1
1412-
|
1412+
|
14131413
5 | ccccc
14141414
| ^
14151415
...
@@ -1422,7 +1422,7 @@ r"blork2.rs:2:1: 2:12
14221422

14231423
let expect = &r#"
14241424
--> dummy.txt:1:1
1425-
|
1425+
|
14261426
1 | aaaaa
14271427
| ^
14281428
...
@@ -1477,7 +1477,7 @@ fn foo() {
14771477
let text = make_string(&lines);
14781478
assert_eq!(&text[..], &"
14791479
--> foo.rs:3:2
1480-
|
1480+
|
14811481
3 | \tbar;
14821482
| \t^^^
14831483
"[1..]);
@@ -1510,7 +1510,7 @@ fn foo() {
15101510
println!("text=\n{}", text);
15111511
assert_eq!(&text[..], &r#"
15121512
::: foo.rs
1513-
|
1513+
|
15141514
3 | vec.push(vec.pop().unwrap());
15151515
| --- --- - previous borrow ends here
15161516
| | |
@@ -1580,14 +1580,14 @@ fn bar() {
15801580
// Note that the `|` remain aligned across both files:
15811581
assert_eq!(&text[..], &r#"
15821582
--> foo.rs:3:14
1583-
|
1583+
|
15841584
3 | vec.push(vec.pop().unwrap());
15851585
| --- ^^^ - c
15861586
| | |
15871587
| | b
15881588
| a
15891589
::: bar.rs
1590-
|
1590+
|
15911591
17 | vec.push();
15921592
| --- - f
15931593
| |
@@ -1632,7 +1632,7 @@ fn foo() {
16321632
println!("text=\n{}", text);
16331633
assert_eq!(&text[..], &r#"
16341634
::: foo.rs
1635-
|
1635+
|
16361636
3 | let name = find_id(&data, 22).unwrap();
16371637
| ---- immutable borrow begins here
16381638
...
@@ -1672,7 +1672,7 @@ fn foo() {
16721672
println!("text=r#\"\n{}\".trim_left()", text);
16731673
assert_eq!(&text[..], &r#"
16741674
::: foo.rs
1675-
|
1675+
|
16761676
3 | vec.push(vec.pop().unwrap());
16771677
| -------- ------ D
16781678
| ||
@@ -1709,7 +1709,7 @@ fn foo() {
17091709
println!("text=r#\"\n{}\".trim_left()", text);
17101710
assert_eq!(&text[..], &r#"
17111711
::: foo.rs
1712-
|
1712+
|
17131713
3 | vec.push(vec.pop().unwrap());
17141714
| --- --- - previous borrow ends here
17151715
| | |
@@ -1748,7 +1748,7 @@ fn foo() {
17481748
println!("text=r#\"\n{}\".trim_left()", text);
17491749
assert_eq!(&text[..], &r#"
17501750
::: foo.rs
1751-
|
1751+
|
17521752
4 | let mut vec2 = vec;
17531753
| --- `vec` moved here because it has type `collections::vec::Vec<i32>`
17541754
...
@@ -1785,7 +1785,7 @@ fn foo() {
17851785
println!("text=&r#\"\n{}\n\"#[1..]", text);
17861786
assert_eq!(text, &r#"
17871787
::: foo.rs
1788-
|
1788+
|
17891789
3 | let mut vec = vec![0, 1, 2];
17901790
| --- ---
17911791
4 | let mut vec2 = vec;
@@ -1817,7 +1817,7 @@ impl SomeTrait for () {
18171817
println!("r#\"\n{}\"", text);
18181818
assert_eq!(text, &r#"
18191819
::: foo.rs
1820-
|
1820+
|
18211821
3 | fn foo(x: u32) {
18221822
| -
18231823
"#[1..]);
@@ -1847,7 +1847,7 @@ impl SomeTrait for () {
18471847
println!("r#\"\n{}\"", text);
18481848
assert_eq!(text, &r#"
18491849
::: foo.rs
1850-
|
1850+
|
18511851
2 | fn foo(x: u32) {
18521852
| --------------
18531853
| | |
@@ -1882,7 +1882,7 @@ impl SomeTrait for () {
18821882
println!("r#\"\n{}\"", text);
18831883
assert_eq!(text, &r#"
18841884
::: foo.rs
1885-
|
1885+
|
18861886
2 | fn foo(x: u32) {
18871887
| --------------
18881888
| | |
@@ -1928,7 +1928,7 @@ impl SomeTrait for () {
19281928
println!("r#\"\n{}\"", text);
19291929
assert_eq!(text, &r#"
19301930
::: foo.rs
1931-
|
1931+
|
19321932
3 | let closure = || {
19331933
| - foo
19341934
4 | inner
@@ -1971,7 +1971,7 @@ fn main() {
19711971
println!("r#\"\n{}\"", text);
19721972
assert_eq!(text, &r#"
19731973
--> foo.rs:11:2
1974-
|
1974+
|
19751975
11 | }
19761976
| -
19771977
"#[1..]);

src/test/ui/mismatched_types/issue-26480.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error[E0308]: mismatched types
22
--> $DIR/issue-26480.rs:27:19
3-
|
3+
|
44
27 | $arr.len() * size_of($arr[0]));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize
66
$DIR/issue-26480.rs:38:5: 38:19 note: in this expansion of write! (defined in $DIR/issue-26480.rs)
77

88
error: non-scalar cast: `_` as `()`
99
--> $DIR/issue-26480.rs:33:19
10-
|
10+
|
1111
33 | ($x:expr) => ($x as ())
1212
| ^^^^^^^^
1313
$DIR/issue-26480.rs:39:5: 39:14 note: in this expansion of cast! (defined in $DIR/issue-26480.rs)

src/test/ui/mismatched_types/main.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
error[E0308]: mismatched types
22
--> $DIR/main.rs:14:18
3-
|
3+
|
44
14 | let x: u32 = (
55
| ^ expected u32, found ()
6-
|
6+
|
77
= note: expected type `u32`
88
= note: found type `()`
99

0 commit comments

Comments
 (0)