forked from rust-lang/rust-clippy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
needless_borrow
test output and expected fix
- Loading branch information
Showing
2 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
error: this expression borrows a reference (`&i32`) that is immediately dereferenced by the compiler | ||
--> $DIR/needless_borrow.rs:14:15 | ||
--> $DIR/needless_borrow.rs:8:15 | ||
| | ||
LL | let c = x(&&a); | ||
LL | let _ = x(&&a); // warn | ||
| ^^^ help: change this to: `&a` | ||
| | ||
= note: `-D clippy::needless-borrow` implied by `-D warnings` | ||
|
||
error: this expression borrows a reference (`&mut i32`) that is immediately dereferenced by the compiler | ||
--> $DIR/needless_borrow.rs:12:13 | ||
| | ||
LL | mut_ref(&mut &mut b); // warn | ||
| ^^^^^^^^^^^ help: change this to: `&mut b` | ||
|
||
error: this expression borrows a reference (`&i32`) that is immediately dereferenced by the compiler | ||
--> $DIR/needless_borrow.rs:27:15 | ||
--> $DIR/needless_borrow.rs:26:15 | ||
| | ||
LL | 46 => &&a, | ||
| ^^^ help: change this to: `&a` | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to 3 previous errors | ||
|