2017-01-14 14:25:33 -06:00
error[E0369]: binary operation `+` cannot be applied to type `&'static str`
--> $DIR/issue-39018.rs:12:13
|
12 | let x = "Hello " + "World!";
2017-03-28 06:06:01 -05:00
| ^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
2017-01-14 14:25:33 -06:00
|
2017-03-28 06:06:01 -05:00
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left.
2017-06-25 15:11:22 -05:00
12 | let x = "Hello ".to_owned() + "World!";
2017-01-14 14:25:33 -06:00
error[E0369]: binary operation `+` cannot be applied to type `World`
--> $DIR/issue-39018.rs:17:13
|
17 | let y = World::Hello + World::Goodbye;
2017-03-28 06:06:01 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2017-01-14 14:25:33 -06:00
|
2017-02-09 14:37:59 -06:00
= note: an implementation of `std::ops::Add` might be missing for `World`
2017-01-14 14:25:33 -06:00
2017-07-02 05:49:30 -05:00
error: aborting due to 2 previous errors
2017-01-14 14:25:33 -06:00