]> git.lizzy.rs Git - rust.git/blob - tests/ui/cmp_owned.stderr
Fixes #2925 cmp_owned false positive
[rust.git] / tests / ui / cmp_owned.stderr
1 error: this creates an owned instance just for comparison
2   --> $DIR/cmp_owned.rs:18:14
3    |
4 18 |         x != "foo".to_string();
5    |              ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
6    |
7    = note: `-D clippy::cmp-owned` implied by `-D warnings`
8
9 error: this creates an owned instance just for comparison
10   --> $DIR/cmp_owned.rs:20:9
11    |
12 20 |         "foo".to_string() != x;
13    |         ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
14
15 error: this creates an owned instance just for comparison
16   --> $DIR/cmp_owned.rs:27:10
17    |
18 27 |     x != "foo".to_owned();
19    |          ^^^^^^^^^^^^^^^^ help: try: `"foo"`
20
21 error: this creates an owned instance just for comparison
22   --> $DIR/cmp_owned.rs:29:10
23    |
24 29 |     x != String::from("foo");
25    |          ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
26
27 error: this creates an owned instance just for comparison
28   --> $DIR/cmp_owned.rs:33:5
29    |
30 33 |     Foo.to_owned() == Foo;
31    |     ^^^^^^^^^^^^^^ help: try: `Foo`
32
33 error: this creates an owned instance just for comparison
34   --> $DIR/cmp_owned.rs:35:30
35    |
36 35 |     "abc".chars().filter(|c| c.to_owned() != 'X');
37    |                              ^^^^^^^^^^^^ help: try: `*c`
38
39 error: this creates an owned instance just for comparison
40   --> $DIR/cmp_owned.rs:44:9
41    |
42 44 |         self.to_owned() == *other
43    |         ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
44
45 error: aborting due to 7 previous errors
46