mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
clean tests/ui/toplevel_ref_arg.rs
Cleaning the empty lines for clarity.
This commit is contained in:
parent
80ca0484c7
commit
24324f84d8
2 changed files with 6 additions and 18 deletions
|
@ -17,24 +17,12 @@ fn main() {
|
|||
|
||||
let ref x = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
let ref y: (&_, u8) = (&1, 2);
|
||||
|
||||
|
||||
|
||||
|
||||
let ref z = 1 + 2;
|
||||
|
||||
|
||||
|
||||
|
||||
let ref mut z = 1 + 2;
|
||||
|
||||
|
||||
|
||||
|
||||
let (ref x, _) = (1,2); // okay, not top level
|
||||
println!("The answer is {}.", x);
|
||||
}
|
||||
|
|
|
@ -20,25 +20,25 @@ error: `ref` on an entire `let` pattern is discouraged, take a reference with `&
|
|||
= note: #[deny(toplevel_ref_arg)] implied by #[deny(clippy)]
|
||||
|
||||
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
|
||||
--> $DIR/toplevel_ref_arg.rs:23:7
|
||||
--> $DIR/toplevel_ref_arg.rs:20:7
|
||||
|
|
||||
23 | let ref y: (&_, u8) = (&1, 2);
|
||||
20 | let ref y: (&_, u8) = (&1, 2);
|
||||
| ----^^^^^--------------------- help: try `let y: &(&_, u8) = &(&1, 2);`
|
||||
|
|
||||
= note: #[deny(toplevel_ref_arg)] implied by #[deny(clippy)]
|
||||
|
||||
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
|
||||
--> $DIR/toplevel_ref_arg.rs:28:7
|
||||
--> $DIR/toplevel_ref_arg.rs:22:7
|
||||
|
|
||||
28 | let ref z = 1 + 2;
|
||||
22 | let ref z = 1 + 2;
|
||||
| ----^^^^^--------- help: try `let z = &(1 + 2);`
|
||||
|
|
||||
= note: #[deny(toplevel_ref_arg)] implied by #[deny(clippy)]
|
||||
|
||||
error: `ref` on an entire `let` pattern is discouraged, take a reference with `&` instead
|
||||
--> $DIR/toplevel_ref_arg.rs:33:7
|
||||
--> $DIR/toplevel_ref_arg.rs:24:7
|
||||
|
|
||||
33 | let ref mut z = 1 + 2;
|
||||
24 | let ref mut z = 1 + 2;
|
||||
| ----^^^^^^^^^--------- help: try `let z = &mut (1 + 2);`
|
||||
|
|
||||
= note: #[deny(toplevel_ref_arg)] implied by #[deny(clippy)]
|
||||
|
|
Loading…
Reference in a new issue