rust/tests/ui/needless_pass_by_value.stderr
sinkuu 0a6bc6031a Rename lint to needless_take_by_value
And fixes false-positives for generics and `match`
2017-02-20 16:02:48 +09:00

44 lines
1.5 KiB
Plaintext

error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:9:23
|
9 | fn foo<T: Default>(v: Vec<T>, w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
| ^^^^^^
|
note: lint level defined here
--> $DIR/needless_pass_by_value.rs:4:9
|
4 | #![deny(needless_pass_by_value)]
| ^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the type to `&[T]`
| fn foo<T: Default>(v: &[T], w: Vec<T>, mut x: Vec<T>, y: Vec<T>) -> Vec<T> {
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:23:11
|
23 | fn bar(x: String, y: Wrapper) {
| ^^^^^^
|
help: consider changing the type to `&str`
| fn bar(x: &str, y: Wrapper) {
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:23:22
|
23 | fn bar(x: String, y: Wrapper) {
| ^^^^^^^
|
help: consider taking a reference instead
| fn bar(x: String, y: &Wrapper) {
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:28:63
|
28 | fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: U) {
| ^
|
help: consider taking a reference instead
| fn test_borrow_trait<T: std::borrow::Borrow<str>, U>(t: T, u: &U) {
error: aborting due to 4 previous errors