Add test to take Self as an argument

This commit is contained in:
sinkuu 2017-11-03 17:56:26 +09:00
parent c102d50ece
commit d88cc5376e
2 changed files with 7 additions and 0 deletions

View File

@ -98,6 +98,7 @@ impl<T: Serialize, U> S<T, U> {
fn baz(
&self,
_u: U,
_s: Self,
) {
}
}

View File

@ -122,3 +122,9 @@ error: this argument is passed by value, but not consumed in the function body
100 | _u: 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`