rust/tests/ui/cmp_owned.stderr

41 lines
1.2 KiB
Plaintext
Raw Normal View History

2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
2017-08-01 10:54:21 -05:00
--> $DIR/cmp_owned.rs:8:14
|
8 | x != "foo".to_string();
2017-07-21 03:40:23 -05:00
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
= note: `-D clippy::cmp-owned` implied by `-D warnings`
2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
2017-08-01 10:54:21 -05:00
--> $DIR/cmp_owned.rs:10:9
|
10 | "foo".to_string() != x;
2017-07-21 03:40:23 -05:00
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
2017-08-01 10:54:21 -05:00
--> $DIR/cmp_owned.rs:17:10
|
17 | x != "foo".to_owned();
2017-07-21 03:40:23 -05:00
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
2017-08-01 10:54:21 -05:00
--> $DIR/cmp_owned.rs:19:10
|
2017-05-11 11:59:36 -05:00
19 | x != String::from("foo");
2017-07-21 03:40:23 -05:00
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
2017-08-01 10:54:21 -05:00
--> $DIR/cmp_owned.rs:23:5
2017-05-11 11:59:36 -05:00
|
23 | Foo.to_owned() == Foo;
2017-07-21 03:40:23 -05:00
| ^^^^^^^^^^^^^^ help: try: `Foo`
2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
2017-08-01 10:54:21 -05:00
--> $DIR/cmp_owned.rs:30:9
2017-05-11 11:59:36 -05:00
|
30 | self.to_owned() == *other
| ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
2018-01-16 10:06:27 -06:00
error: aborting due to 6 previous errors