rust-clippy/tests/ui/cmp_owned.stderr
2018-12-10 08:22:07 +01:00

58 lines
1.8 KiB
Text

error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:14:14
|
14 | x != "foo".to_string();
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
= note: `-D clippy::cmp-owned` implied by `-D warnings`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:16:9
|
16 | "foo".to_string() != x;
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:23:10
|
23 | x != "foo".to_owned();
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:25:10
|
25 | x != String::from("foo");
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:29:5
|
29 | Foo.to_owned() == Foo;
| ^^^^^^^^^^^^^^ help: try: `Foo`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:31:30
|
31 | "abc".chars().filter(|c| c.to_owned() != 'X');
| ^^^^^^^^^^^^ help: try: `*c`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:38:5
|
38 | y.to_owned() == *x;
| ^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:43:5
|
43 | y.to_owned() == **x;
| ^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:50:9
|
50 | self.to_owned() == *other
| ^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: aborting due to 9 previous errors