]> git.proxmox.com Git - rustc.git/blame - src/test/ui/str/str-concat-on-double-ref.stderr
New upstream version 1.42.0+dfsg1
[rustc.git] / src / test / ui / str / str-concat-on-double-ref.stderr
CommitLineData
dfeec247 1error[E0369]: cannot add `&str` to `&std::string::String`
532ac7d7 2 --> $DIR/str-concat-on-double-ref.rs:4:15
ff7c6d11 3 |
0531ce1d 4LL | 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 10help: `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
12LL | let c = a.to_owned() + b;
13 | ^^^^^^^^^^^^
ff7c6d11
XL
14
15error: aborting due to previous error
16
0531ce1d 17For more information about this error, try `rustc --explain E0369`.