]> git.lizzy.rs Git - rust.git/blob - tests/ui/cmp_owned.stderr
Merge pull request #1749 from Manishearth/cmp_owned
[rust.git] / tests / ui / cmp_owned.stderr
1 error: this creates an owned instance just for comparison
2  --> $DIR/cmp_owned.rs:8:14
3   |
4 8 |         x != "foo".to_string();
5   |              ^^^^^^^^^^^^^^^^^ help: try `"foo"`
6   |
7 note: lint level defined here
8  --> $DIR/cmp_owned.rs:4:8
9   |
10 4 | #[deny(cmp_owned)]
11   |        ^^^^^^^^^
12
13 error: this creates an owned instance just for comparison
14   --> $DIR/cmp_owned.rs:10:9
15    |
16 10 |         "foo".to_string() != x;
17    |         ^^^^^^^^^^^^^^^^^ help: try `"foo"`
18
19 error: this creates an owned instance just for comparison
20   --> $DIR/cmp_owned.rs:17:10
21    |
22 17 |     x != "foo".to_owned();
23    |          ^^^^^^^^^^^^^^^^ help: try `"foo"`
24
25 error: this creates an owned instance just for comparison
26   --> $DIR/cmp_owned.rs:19:10
27    |
28 19 |     x != String::from("foo");
29    |          ^^^^^^^^^^^^^^^^^^^ help: try `"foo"`
30
31 error: this creates an owned instance just for comparison
32   --> $DIR/cmp_owned.rs:23:5
33    |
34 23 |     Foo.to_owned() == Foo;
35    |     ^^^^^^^^^^^^^^ help: try `Foo`
36
37 warning: this creates an owned instance just for comparison
38   --> $DIR/cmp_owned.rs:30:9
39    |
40 30 |         self.to_owned() == *other
41    |         ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
42    |
43    = note: #[warn(cmp_owned)] on by default
44
45 error: aborting due to 5 previous errors
46