2017-02-20 03:50:31 +00:00
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:9:23
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
|
|
|
9 | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^ help: consider changing the type to: `&[T]`
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
2017-05-17 12:19:44 +00:00
|
|
|
= note: `-D needless-pass-by-value` implied by `-D warnings`
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:23:11
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
|
|
|
23 | fn bar(x: String, y: Wrapper) {
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^ help: consider changing the type to: `&str`
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:23:22
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
|
|
|
23 | fn bar(x: String, y: Wrapper) {
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:29:63
|
2017-02-20 03:50:31 +00:00
|
|
|
|
|
2017-02-20 07:45:37 +00:00
|
|
|
29 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^ help: consider taking a reference instead: `&U`
|
2017-02-20 03:50:31 +00:00
|
|
|
|
2017-02-20 07:45:37 +00:00
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:40:18
|
2017-02-20 07:45:37 +00:00
|
|
|
|
|
|
|
|
40 | fn test_match(x: Option<Option<String>>, y: Option<Option<String>>) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: consider taking a reference instead
|
2017-07-10 13:29:29 +00:00
|
|
|
|
|
|
|
|
40 | fn test_match(x: &Option<Option<String>>, y: Option<Option<String>>) {
|
|
|
|
41 | match *x {
|
|
|
|
|
|
2017-02-20 07:45:37 +00:00
|
|
|
|
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:53:24
|
2017-02-20 07:45:37 +00:00
|
|
|
|
|
2017-02-20 09:18:31 +00:00
|
|
|
53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
|
2017-07-21 08:40:23 +00:00
|
|
|
| ^^^^^^^ help: consider taking a reference instead: `&Wrapper`
|
2017-02-20 07:45:37 +00:00
|
|
|
|
2017-02-20 09:18:31 +00:00
|
|
|
error: this argument is passed by value, but not consumed in the function body
|
2017-08-01 15:54:21 +00:00
|
|
|
--> $DIR/needless_pass_by_value.rs:53:36
|
2017-02-20 09:18:31 +00:00
|
|
|
|
|
|
|
|
53 | fn test_destructure(x: Wrapper, y: Wrapper, z: Wrapper) {
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
|
|
|
help: consider taking a reference instead
|
2017-07-10 13:29:29 +00:00
|
|
|
|
|
|
|
|
53 | fn test_destructure(x: Wrapper, y: &Wrapper, z: Wrapper) {
|
|
|
|
54 | let Wrapper(s) = z; // moved
|
|
|
|
55 | let Wrapper(ref t) = *y; // not moved
|
|
|
|
56 | let Wrapper(_) = *y; // still not moved
|
|
|
|
|
|
2017-02-20 09:18:31 +00:00
|
|
|
|
2017-07-03 04:37:30 +00:00
|
|
|
error: aborting due to 7 previous errors
|
2017-02-20 03:50:31 +00:00
|
|
|
|