rust-clippy/tests/ui/cmp_owned.stderr

47 lines
1.3 KiB
Text
Raw Normal View History

2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:8:14
|
8 | x != "foo".to_string();
2017-05-11 16:59:36 +00:00
| ^^^^^^^^^^^^^^^^^ help: try `"foo"`
|
note: lint level defined here
--> $DIR/cmp_owned.rs:4:8
|
4 | #[deny(cmp_owned)]
| ^^^^^^^^^
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:10:9
|
10 | "foo".to_string() != x;
2017-05-11 16:59:36 +00:00
| ^^^^^^^^^^^^^^^^^ help: try `"foo"`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:17:10
|
17 | x != "foo".to_owned();
2017-05-11 16:59:36 +00:00
| ^^^^^^^^^^^^^^^^ help: try `"foo"`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:19:10
|
2017-05-11 16:59:36 +00:00
19 | x != String::from("foo");
| ^^^^^^^^^^^^^^^^^^^ help: try `"foo"`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:23:5
|
23 | Foo.to_owned() == Foo;
| ^^^^^^^^^^^^^^ help: try `Foo`
warning: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:30:9
|
30 | self.to_owned() == *other
| ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
|
= note: #[warn(cmp_owned)] on by default
error: aborting due to 5 previous errors