rust/tests/ui/cmp_owned.stderr

59 lines
1.8 KiB
Plaintext
Raw Normal View History

2017-05-11 11:59:36 -05:00
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:5:14
2018-10-06 11:18:06 -05:00
|
2018-12-27 09:57:55 -06:00
LL | x != "foo".to_string();
2018-10-06 11:18:06 -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
--> $DIR/cmp_owned.rs:7:9
|
2018-12-27 09:57:55 -06:00
LL | "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
--> $DIR/cmp_owned.rs:14:10
|
2018-12-27 09:57:55 -06:00
LL | 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
--> $DIR/cmp_owned.rs:16:10
|
2018-12-27 09:57:55 -06:00
LL | 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
--> $DIR/cmp_owned.rs:20:5
2017-05-11 11:59:36 -05:00
|
2018-12-27 09:57:55 -06:00
LL | 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
--> $DIR/cmp_owned.rs:22:30
2017-05-11 11:59:36 -05:00
|
2018-12-27 09:57:55 -06:00
LL | "abc".chars().filter(|c| c.to_owned() != 'X');
2018-10-08 21:04:29 -05:00
| ^^^^^^^^^^^^ help: try: `*c`
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:29:5
2018-10-08 21:04:29 -05:00
|
2018-12-27 09:57:55 -06:00
LL | y.to_owned() == *x;
| ^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:34:5
|
2018-12-27 09:57:55 -06:00
LL | y.to_owned() == **x;
| ^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/cmp_owned.rs:41:9
|
2018-12-27 09:57:55 -06:00
LL | self.to_owned() == *other
| ^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: aborting due to 9 previous errors
2018-01-16 10:06:27 -06:00