]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | error[E0369]: cannot add `&str` to `&std::string::String` |
532ac7d7 | 2 | --> $DIR/str-concat-on-double-ref.rs:4:15 |
ff7c6d11 | 3 | | |
0531ce1d | 4 | LL | let c = a + b; |
532ac7d7 | 5 | | - ^ - &str |
48663c56 XL |
6 | | | | |
7 | | | `+` cannot be used to concatenate two `&str` strings | |
532ac7d7 | 8 | | &std::string::String |
e74abb32 | 9 | | |
48663c56 | 10 | 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 |
ff7c6d11 | 11 | | |
48663c56 XL |
12 | LL | let c = a.to_owned() + b; |
13 | | ^^^^^^^^^^^^ | |
ff7c6d11 XL |
14 | |
15 | error: aborting due to previous error | |
16 | ||
0531ce1d | 17 | For more information about this error, try `rustc --explain E0369`. |