mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Add test to take Self
as an argument
This commit is contained in:
parent
c102d50ece
commit
d88cc5376e
@ -98,6 +98,7 @@ impl<T: Serialize, U> S<T, U> {
|
||||
fn baz(
|
||||
&self,
|
||||
_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,
|
||||
| ^ 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 New Issue
Block a user