]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/issue-39018.stderr
Auto merge of #54624 - arielb1:evaluate-outlives, r=nikomatsakis
[rust.git] / src / test / ui / span / issue-39018.stderr
1 error[E0369]: binary operation `+` cannot be applied to type `&str`
2   --> $DIR/issue-39018.rs:12:13
3    |
4 LL |     let x = "Hello " + "World!";
5    |             ^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate two `&str` strings
6 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
7    |
8 LL |     let x = "Hello ".to_owned() + "World!";
9    |             ^^^^^^^^^^^^^^^^^^^
10
11 error[E0369]: binary operation `+` cannot be applied to type `World`
12   --> $DIR/issue-39018.rs:18:13
13    |
14 LL |     let y = World::Hello + World::Goodbye;
15    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16    |
17    = note: an implementation of `std::ops::Add` might be missing for `World`
18
19 error[E0369]: binary operation `+` cannot be applied to type `&str`
20   --> $DIR/issue-39018.rs:21:13
21    |
22 LL |     let x = "Hello " + "World!".to_owned();
23    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `+` can't be used to concatenate a `&str` with a `String`
24 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
25    |
26 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
27    |             ^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^^^^^^
28
29 error: aborting due to 3 previous errors
30
31 For more information about this error, try `rustc --explain E0369`.