]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/cmp_owned.stderr
327134c12894c1059716b2d2552fb86d57863565
[rust.git] / clippy_tests / examples / cmp_owned.stderr
1 error: this creates an owned instance just for comparison
2  --> cmp_owned.rs:8:14
3   |
4 8 |         x != "foo".to_string();
5   |              ^^^^^^^^^^^^^^^^^ help: try `"foo"`
6   |
7   = note: `-D cmp-owned` implied by `-D warnings`
8
9 error: this creates an owned instance just for comparison
10   --> cmp_owned.rs:10:9
11    |
12 10 |         "foo".to_string() != x;
13    |         ^^^^^^^^^^^^^^^^^ help: try `"foo"`
14    |
15    = note: `-D cmp-owned` implied by `-D warnings`
16
17 error: this creates an owned instance just for comparison
18   --> cmp_owned.rs:17:10
19    |
20 17 |     x != "foo".to_owned();
21    |          ^^^^^^^^^^^^^^^^ help: try `"foo"`
22    |
23    = note: `-D cmp-owned` implied by `-D warnings`
24
25 error: this creates an owned instance just for comparison
26   --> cmp_owned.rs:19:10
27    |
28 19 |     x != String::from("foo");
29    |          ^^^^^^^^^^^^^^^^^^^ help: try `"foo"`
30    |
31    = note: `-D cmp-owned` implied by `-D warnings`
32
33 error: this creates an owned instance just for comparison
34   --> cmp_owned.rs:23:5
35    |
36 23 |     Foo.to_owned() == Foo;
37    |     ^^^^^^^^^^^^^^ help: try `Foo`
38    |
39    = note: `-D cmp-owned` implied by `-D warnings`
40
41 error: this creates an owned instance just for comparison
42   --> cmp_owned.rs:30:9
43    |
44 30 |         self.to_owned() == *other
45    |         ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
46    |
47    = note: `-D cmp-owned` implied by `-D warnings`
48
49 error: aborting due to previous error(s)
50
51 error: Could not compile `clippy_tests`.
52
53 To learn more, run the command again with --verbose.