mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Add test to take Self
as an argument
This commit is contained in:
parent
c102d50ece
commit
d88cc5376e
2 changed files with 7 additions and 0 deletions
|
@ -98,6 +98,7 @@ impl<T: Serialize, U> S<T, U> {
|
||||||
fn baz(
|
fn baz(
|
||||||
&self,
|
&self,
|
||||||
_u: U,
|
_u: U,
|
||||||
|
_s: Self,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,3 +122,9 @@ error: this argument is passed by value, but not consumed in the function body
|
||||||
100 | _u: U,
|
100 | _u: U,
|
||||||
| ^ help: consider taking a reference instead: `&U`
|
| ^ help: consider taking a reference instead: `&U`
|
||||||
|
|
||||||
|
error: this argument is passed by value, but not consumed in the function body
|
||||||
|
--> $DIR/needless_pass_by_value.rs:101:13
|
||||||
|
|
|
||||||
|
101 | _s: Self,
|
||||||
|
| ^^^^ help: consider taking a reference instead: `&Self`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue