-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not lint if used as a
fn
-like argument
- Loading branch information
Showing
8 changed files
with
183 additions
and
83 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
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
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
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,28 +1,34 @@ | ||
error: this argument is a mutable reference, but not used mutably | ||
--> $DIR/needless_pass_by_ref_mut.rs:6:11 | ||
--> $DIR/needless_pass_by_ref_mut.rs:50:31 | ||
| | ||
LL | fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>` | ||
LL | fn badger(&mut self, vec: &mut Vec<i32>) -> usize { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<i32>` | ||
| | ||
= note: `-D clippy::needless-pass-by-ref-mut` implied by `-D warnings` | ||
|
||
error: this argument is a mutable reference, but not used mutably | ||
--> $DIR/needless_pass_by_ref_mut.rs:31:12 | ||
--> $DIR/needless_pass_by_ref_mut.rs:7:11 | ||
| | ||
LL | fn foo6(s: &mut Vec<u32>) { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>` | ||
LL | fn foo(s: &mut Vec<u32>, b: &u32, x: &mut u32) { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>` | ||
|
||
error: this argument is a mutable reference, but not used mutably | ||
--> $DIR/needless_pass_by_ref_mut.rs:44:29 | ||
--> $DIR/needless_pass_by_ref_mut.rs:45:29 | ||
| | ||
LL | fn mushroom(&self, vec: &mut Vec<i32>) -> usize { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<i32>` | ||
|
||
error: this argument is a mutable reference, but not used mutably | ||
--> $DIR/needless_pass_by_ref_mut.rs:49:31 | ||
--> $DIR/needless_pass_by_ref_mut.rs:32:12 | ||
| | ||
LL | fn badger(&mut self, vec: &mut Vec<i32>) -> usize { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<i32>` | ||
LL | fn foo6(s: &mut Vec<u32>) { | ||
| ^^^^^^^^^^^^^ help: consider changing to: `&Vec<u32>` | ||
|
||
error: this argument is a mutable reference, but not used mutably | ||
--> $DIR/needless_pass_by_ref_mut.rs:108:20 | ||
| | ||
LL | fn used_as_path(s: &mut u32) {} | ||
| ^^^^^^^^ help: consider changing to: `&u32` | ||
|
||
error: aborting due to 4 previous errors | ||
error: aborting due to 5 previous errors | ||
|
Oops, something went wrong.