rust-clippy/tests/ui/cmp_owned.stderr
2018-10-09 19:25:03 -07:00

52 lines
1.6 KiB
Text

error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:18:14
|
18 | 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:20:9
|
20 | "foo".to_string() != x;
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:27:10
|
27 | x != "foo".to_owned();
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:29:10
|
29 | x != String::from("foo");
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:33:5
|
33 | Foo.to_owned() == Foo;
| ^^^^^^^^^^^^^^ help: try: `Foo`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:35:30
|
35 | "abc".chars().filter(|c| c.to_owned() != 'X');
| ^^^^^^^^^^^^ help: try: `*c`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:42:5
|
42 | y.to_owned() == *x;
| ^^^^^^^^^^^^^^^^^^ help: try: `y == x`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:49:9
|
49 | self.to_owned() == *other
| ^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: aborting due to 8 previous errors