rust-clippy/tests/ui/cmp_owned/with_suggestion.stderr

41 lines
1.2 KiB
Text
Raw Normal View History

2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:7:14
2018-10-06 16:18:06 +00:00
|
2018-12-27 15:57:55 +00:00
LL | x != "foo".to_string();
2018-10-06 16:18:06 +00:00
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
= note: `-D clippy::cmp-owned` implied by `-D warnings`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:9:9
|
2018-12-27 15:57:55 +00:00
LL | "foo".to_string() != x;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:16:10
|
2018-12-27 15:57:55 +00:00
LL | x != "foo".to_owned();
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:18:10
|
2018-12-27 15:57:55 +00:00
LL | x != String::from("foo");
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:22:5
2017-05-11 16:59:36 +00:00
|
2018-12-27 15:57:55 +00:00
LL | Foo.to_owned() == Foo;
2017-07-21 08:40:23 +00:00
| ^^^^^^^^^^^^^^ help: try: `Foo`
2017-05-11 16:59:36 +00:00
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:24:30
2017-05-11 16:59:36 +00:00
|
2018-12-27 15:57:55 +00:00
LL | "abc".chars().filter(|c| c.to_owned() != 'X');
2018-10-09 02:04:29 +00:00
| ^^^^^^^^^^^^ help: try: `*c`
error: aborting due to 6 previous errors
2018-01-16 16:06:27 +00:00