mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:8:14
|
|
|
|
|
8 | x != "foo".to_string();
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
|
= note: `-D cmp-owned` implied by `-D warnings`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:10:9
|
|
|
|
|
10 | "foo".to_string() != x;
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:17:10
|
|
|
|
|
17 | x != "foo".to_owned();
|
|
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:19:10
|
|
|
|
|
19 | x != String::from("foo");
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:23:5
|
|
|
|
|
23 | Foo.to_owned() == Foo;
|
|
| ^^^^^^^^^^^^^^ help: try: `Foo`
|
|
|
|
error: this creates an owned instance just for comparison
|
|
--> $DIR/cmp_owned.rs:30:9
|
|
|
|
|
30 | self.to_owned() == *other
|
|
| ^^^^^^^^^^^^^^^ try calling implementing the comparison without allocating
|
|
|
|
error: aborting due to 6 previous errors
|
|
|