Skip to content

Commit

Permalink
Fix up some tidy-unfriendly spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Turner committed Jul 14, 2016
1 parent 2f2c3e1 commit 012ff15
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
10 changes: 7 additions & 3 deletions src/librustc_errors/emitter.rs
Expand Up @@ -534,7 +534,7 @@ impl EmitterWriter {

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

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

fn draw_col_separator_no_space(buffer: &mut StyledBuffer, line: usize, col: usize) {
buffer.puts(line, col, "|", Style::LineNumber);
}

fn draw_note_separator(buffer: &mut StyledBuffer, line: usize, col: usize) {
buffer.puts(line, col, "= ", Style::LineNumber);
}
Expand Down Expand Up @@ -1087,4 +1091,4 @@ impl Write for Destination {
Raw(ref mut w) => w.flush(),
}
}
}
}
36 changes: 18 additions & 18 deletions src/libsyntax/codemap.rs
Expand Up @@ -1265,7 +1265,7 @@ r"blork2.rs:2:1: 2:12
println!("r#\"\n{}\"#", str);
assert_eq!(str, &r#"
--> dummy.txt:11:1
|
|
11 | e-lä-vän
| ^
"#[1..]);
Expand Down Expand Up @@ -1333,7 +1333,7 @@ r"blork2.rs:2:1: 2:12

let expect_start = &r#"
--> dummy.txt:1:6
|
|
1 | _____aaaaaa____bbbbbb__cccccdd_
| ^^^^^^ ^^^^^^ ^^^^^^^
"#[1..];
Expand Down Expand Up @@ -1409,7 +1409,7 @@ r"blork2.rs:2:1: 2:12

let expect0 = &r#"
--> dummy.txt:5:1
|
|
5 | ccccc
| ^
...
Expand All @@ -1422,7 +1422,7 @@ r"blork2.rs:2:1: 2:12

let expect = &r#"
--> dummy.txt:1:1
|
|
1 | aaaaa
| ^
...
Expand Down Expand Up @@ -1477,7 +1477,7 @@ fn foo() {
let text = make_string(&lines);
assert_eq!(&text[..], &"
--> foo.rs:3:2
|
|
3 | \tbar;
| \t^^^
"[1..]);
Expand Down Expand Up @@ -1510,7 +1510,7 @@ fn foo() {
println!("text=\n{}", text);
assert_eq!(&text[..], &r#"
::: foo.rs
|
|
3 | vec.push(vec.pop().unwrap());
| --- --- - previous borrow ends here
| | |
Expand Down Expand Up @@ -1580,14 +1580,14 @@ fn bar() {
// Note that the `|` remain aligned across both files:
assert_eq!(&text[..], &r#"
--> foo.rs:3:14
|
|
3 | vec.push(vec.pop().unwrap());
| --- ^^^ - c
| | |
| | b
| a
::: bar.rs
|
|
17 | vec.push();
| --- - f
| |
Expand Down Expand Up @@ -1632,7 +1632,7 @@ fn foo() {
println!("text=\n{}", text);
assert_eq!(&text[..], &r#"
::: foo.rs
|
|
3 | let name = find_id(&data, 22).unwrap();
| ---- immutable borrow begins here
...
Expand Down Expand Up @@ -1672,7 +1672,7 @@ fn foo() {
println!("text=r#\"\n{}\".trim_left()", text);
assert_eq!(&text[..], &r#"
::: foo.rs
|
|
3 | vec.push(vec.pop().unwrap());
| -------- ------ D
| ||
Expand Down Expand Up @@ -1709,7 +1709,7 @@ fn foo() {
println!("text=r#\"\n{}\".trim_left()", text);
assert_eq!(&text[..], &r#"
::: foo.rs
|
|
3 | vec.push(vec.pop().unwrap());
| --- --- - previous borrow ends here
| | |
Expand Down Expand Up @@ -1748,7 +1748,7 @@ fn foo() {
println!("text=r#\"\n{}\".trim_left()", text);
assert_eq!(&text[..], &r#"
::: foo.rs
|
|
4 | let mut vec2 = vec;
| --- `vec` moved here because it has type `collections::vec::Vec<i32>`
...
Expand Down Expand Up @@ -1785,7 +1785,7 @@ fn foo() {
println!("text=&r#\"\n{}\n\"#[1..]", text);
assert_eq!(text, &r#"
::: foo.rs
|
|
3 | let mut vec = vec![0, 1, 2];
| --- ---
4 | let mut vec2 = vec;
Expand Down Expand Up @@ -1817,7 +1817,7 @@ impl SomeTrait for () {
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
|
|
3 | fn foo(x: u32) {
| -
"#[1..]);
Expand Down Expand Up @@ -1847,7 +1847,7 @@ impl SomeTrait for () {
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
|
|
2 | fn foo(x: u32) {
| --------------
| | |
Expand Down Expand Up @@ -1882,7 +1882,7 @@ impl SomeTrait for () {
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
|
|
2 | fn foo(x: u32) {
| --------------
| | |
Expand Down Expand Up @@ -1928,7 +1928,7 @@ impl SomeTrait for () {
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
::: foo.rs
|
|
3 | let closure = || {
| - foo
4 | inner
Expand Down Expand Up @@ -1971,7 +1971,7 @@ fn main() {
println!("r#\"\n{}\"", text);
assert_eq!(text, &r#"
--> foo.rs:11:2
|
|
11 | }
| -
"#[1..]);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/mismatched_types/issue-26480.stderr
@@ -1,13 +1,13 @@
error[E0308]: mismatched types
--> $DIR/issue-26480.rs:27:19
|
|
27 | $arr.len() * size_of($arr[0]));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected u64, found usize
$DIR/issue-26480.rs:38:5: 38:19 note: in this expansion of write! (defined in $DIR/issue-26480.rs)

error: non-scalar cast: `_` as `()`
--> $DIR/issue-26480.rs:33:19
|
|
33 | ($x:expr) => ($x as ())
| ^^^^^^^^
$DIR/issue-26480.rs:39:5: 39:14 note: in this expansion of cast! (defined in $DIR/issue-26480.rs)
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/mismatched_types/main.stderr
@@ -1,9 +1,9 @@
error[E0308]: mismatched types
--> $DIR/main.rs:14:18
|
|
14 | let x: u32 = (
| ^ expected u32, found ()
|
|
= note: expected type `u32`
= note: found type `()`

Expand Down

0 comments on commit 012ff15

Please sign in to comment.