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( fn baz(
&self, &self,
_u: U, _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, 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`