Fix up some tidy-unfriendly spacing
This commit is contained in:
parent
2f2c3e1783
commit
012ff15c94
4 changed files with 29 additions and 25 deletions
|
|
@ -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() {
|
||||
|
|
@ -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)
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -1087,4 +1091,4 @@ impl Write for Destination {
|
|||
Raw(ref mut w) => w.flush(),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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..]);
|
||||
|
|
@ -1333,7 +1333,7 @@ r"blork2.rs:2:1: 2:12
|
|||
|
||||
let expect_start = &r#"
|
||||
--> dummy.txt:1:6
|
||||
|
|
||||
|
|
||||
1 | _____aaaaaa____bbbbbb__cccccdd_
|
||||
| ^^^^^^ ^^^^^^ ^^^^^^^
|
||||
"#[1..];
|
||||
|
|
@ -1409,7 +1409,7 @@ r"blork2.rs:2:1: 2:12
|
|||
|
||||
let expect0 = &r#"
|
||||
--> dummy.txt:5:1
|
||||
|
|
||||
|
|
||||
5 | ccccc
|
||||
| ^
|
||||
...
|
||||
|
|
@ -1422,7 +1422,7 @@ r"blork2.rs:2:1: 2:12
|
|||
|
||||
let expect = &r#"
|
||||
--> dummy.txt:1:1
|
||||
|
|
||||
|
|
||||
1 | aaaaa
|
||||
| ^
|
||||
...
|
||||
|
|
@ -1477,7 +1477,7 @@ fn foo() {
|
|||
let text = make_string(&lines);
|
||||
assert_eq!(&text[..], &"
|
||||
--> foo.rs:3:2
|
||||
|
|
||||
|
|
||||
3 | \tbar;
|
||||
| \t^^^
|
||||
"[1..]);
|
||||
|
|
@ -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
|
||||
| | |
|
||||
|
|
@ -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
|
||||
| |
|
||||
|
|
@ -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
|
||||
...
|
||||
|
|
@ -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
|
||||
| ||
|
||||
|
|
@ -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
|
||||
| | |
|
||||
|
|
@ -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>`
|
||||
...
|
||||
|
|
@ -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;
|
||||
|
|
@ -1817,7 +1817,7 @@ impl SomeTrait for () {
|
|||
println!("r#\"\n{}\"", text);
|
||||
assert_eq!(text, &r#"
|
||||
::: foo.rs
|
||||
|
|
||||
|
|
||||
3 | fn foo(x: u32) {
|
||||
| -
|
||||
"#[1..]);
|
||||
|
|
@ -1847,7 +1847,7 @@ impl SomeTrait for () {
|
|||
println!("r#\"\n{}\"", text);
|
||||
assert_eq!(text, &r#"
|
||||
::: foo.rs
|
||||
|
|
||||
|
|
||||
2 | fn foo(x: u32) {
|
||||
| --------------
|
||||
| | |
|
||||
|
|
@ -1882,7 +1882,7 @@ impl SomeTrait for () {
|
|||
println!("r#\"\n{}\"", text);
|
||||
assert_eq!(text, &r#"
|
||||
::: foo.rs
|
||||
|
|
||||
|
|
||||
2 | fn foo(x: u32) {
|
||||
| --------------
|
||||
| | |
|
||||
|
|
@ -1928,7 +1928,7 @@ impl SomeTrait for () {
|
|||
println!("r#\"\n{}\"", text);
|
||||
assert_eq!(text, &r#"
|
||||
::: foo.rs
|
||||
|
|
||||
|
|
||||
3 | let closure = || {
|
||||
| - foo
|
||||
4 | inner
|
||||
|
|
@ -1971,7 +1971,7 @@ fn main() {
|
|||
println!("r#\"\n{}\"", text);
|
||||
assert_eq!(text, &r#"
|
||||
--> foo.rs:11:2
|
||||
|
|
||||
|
|
||||
11 | }
|
||||
| -
|
||||
"#[1..]);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 `()`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue