clean tests/ui/reference.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 15:38:19 +01:00
parent 7d2e0cb435
commit 36ba4885ab
2 changed files with 27 additions and 60 deletions

View File

@ -18,62 +18,32 @@ fn main() {
let b = *&a;
let b = *&get_number();
let b = *get_reference(&a);
let bytes : Vec<usize> = vec![1, 2, 3, 4];
let b = *&bytes[1..2][0];
//This produces a suggestion of 'let b = (a);' which
//will trigger the 'unused_parens' lint
let b = *&(a);
let b = *(&a);
let b = *((&a));
let b = *&&a;
let b = **&aref;
//This produces a suggestion of 'let b = *&a;' which
//will trigger the 'deref_addrof' lint again
let b = **&&a;
{
let mut x = 10;
let y = *&mut x;
}
{
@ -81,8 +51,5 @@ fn main() {
//will trigger the 'deref_addrof' lint again
let mut x = 10;
let y = **&mut &mut x;
}
}

View File

@ -11,63 +11,63 @@ note: lint level defined here
| ^^^^^^^^^^^^
error: immediately dereferencing a reference
--> $DIR/reference.rs:24:13
--> $DIR/reference.rs:21:13
|
24 | let b = *&get_number();
21 | let b = *&get_number();
| ^^^^^^^^^^^^^^ help: try this `get_number()`
error: immediately dereferencing a reference
--> $DIR/reference.rs:26:13
|
26 | let b = *&bytes[1..2][0];
| ^^^^^^^^^^^^^^^^ help: try this `bytes[1..2][0]`
error: immediately dereferencing a reference
--> $DIR/reference.rs:30:13
|
30 | let b = *&(a);
| ^^^^^ help: try this `(a)`
error: immediately dereferencing a reference
--> $DIR/reference.rs:32:13
|
32 | let b = *&bytes[1..2][0];
| ^^^^^^^^^^^^^^^^ help: try this `bytes[1..2][0]`
error: immediately dereferencing a reference
--> $DIR/reference.rs:39:13
|
39 | let b = *&(a);
| ^^^^^ help: try this `(a)`
error: immediately dereferencing a reference
--> $DIR/reference.rs:44:13
|
44 | let b = *(&a);
32 | let b = *(&a);
| ^^^^^ help: try this `a`
error: immediately dereferencing a reference
--> $DIR/reference.rs:49:13
--> $DIR/reference.rs:34:13
|
49 | let b = *((&a));
34 | let b = *((&a));
| ^^^^^^^ help: try this `a`
error: immediately dereferencing a reference
--> $DIR/reference.rs:54:13
--> $DIR/reference.rs:36:13
|
54 | let b = *&&a;
36 | let b = *&&a;
| ^^^^ help: try this `&a`
error: immediately dereferencing a reference
--> $DIR/reference.rs:59:14
--> $DIR/reference.rs:38:14
|
59 | let b = **&aref;
38 | let b = **&aref;
| ^^^^^^ help: try this `aref`
error: immediately dereferencing a reference
--> $DIR/reference.rs:66:14
--> $DIR/reference.rs:42:14
|
66 | let b = **&&a;
42 | let b = **&&a;
| ^^^^ help: try this `&a`
error: immediately dereferencing a reference
--> $DIR/reference.rs:73:17
--> $DIR/reference.rs:46:17
|
73 | let y = *&mut x;
46 | let y = *&mut x;
| ^^^^^^^ help: try this `x`
error: immediately dereferencing a reference
--> $DIR/reference.rs:83:18
--> $DIR/reference.rs:53:18
|
83 | let y = **&mut &mut x;
53 | let y = **&mut &mut x;
| ^^^^^^^^^^^^ help: try this `&mut x`
error: aborting due to 11 previous errors