blob: d193955af4ba6da1157b846537985c6d1141ad70 [file] [log] [blame]
error[E0369]: binary operation `+` cannot be applied to type `&std::string::String`
--> $DIR/str-concat-on-double-ref.rs:4:15
|
LL | let c = a + b;
| - ^ - &str
| | |
| | `+` cannot be used to concatenate two `&str` strings
| &std::string::String
|
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
|
LL | let c = a.to_owned() + b;
| ^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0369`.