1 error[E0369]: cannot add `&str` to `&str`
2 --> $DIR/issue-39018.rs:2:22
4 LL | let x = "Hello " + "World!";
5 | -------- ^ -------- &str
7 | | `+` cannot be used to concatenate two `&str` strings
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
12 LL | let x = "Hello ".to_owned() + "World!";
15 error[E0369]: cannot add `World` to `World`
16 --> $DIR/issue-39018.rs:8:26
18 LL | let y = World::Hello + World::Goodbye;
19 | ------------ ^ -------------- World
23 = note: an implementation of `std::ops::Add` might be missing for `World`
25 error[E0369]: cannot add `String` to `&str`
26 --> $DIR/issue-39018.rs:11:22
28 LL | let x = "Hello " + "World!".to_owned();
29 | -------- ^ ------------------- String
31 | | `+` cannot be used to concatenate a `&str` with a `String`
34 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
36 LL | let x = "Hello ".to_owned() + &"World!".to_owned();
37 | ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
39 error[E0369]: cannot add `&String` to `&String`
40 --> $DIR/issue-39018.rs:26:16
45 | | `+` cannot be used to concatenate two `&str` strings
48 help: 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
53 error[E0369]: cannot add `String` to `&String`
54 --> $DIR/issue-39018.rs:27:16
59 | | `+` cannot be used to concatenate a `&str` with a `String`
62 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
67 error[E0308]: mismatched types
68 --> $DIR/issue-39018.rs:29:17
73 | expected `&str`, found struct `String`
74 | help: consider borrowing here: `&b`
76 error[E0369]: cannot add `String` to `&String`
77 --> $DIR/issue-39018.rs:30:15
82 | | `+` cannot be used to concatenate a `&str` with a `String`
85 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
87 LL | let _ = e.to_owned() + &b;
90 error[E0369]: cannot add `&String` to `&String`
91 --> $DIR/issue-39018.rs:31:15
96 | | `+` cannot be used to concatenate two `&str` strings
99 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
101 LL | let _ = e.to_owned() + &b;
104 error[E0369]: cannot add `&str` to `&String`
105 --> $DIR/issue-39018.rs:32:15
110 | | `+` cannot be used to concatenate two `&str` strings
113 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
115 LL | let _ = e.to_owned() + d;
118 error[E0369]: cannot add `&&str` to `&String`
119 --> $DIR/issue-39018.rs:33:15
124 | | `+` cannot be used to concatenate two `&str` strings
127 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
129 LL | let _ = e.to_owned() + &d;
132 error[E0369]: cannot add `&&str` to `&&str`
133 --> $DIR/issue-39018.rs:34:16
135 LL | let _ = &c + &d;
140 error[E0369]: cannot add `&str` to `&&str`
141 --> $DIR/issue-39018.rs:35:16
148 error[E0369]: cannot add `&&str` to `&str`
149 --> $DIR/issue-39018.rs:36:15
154 | | `+` cannot be used to concatenate two `&str` strings
157 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
159 LL | let _ = c.to_owned() + &d;
162 error[E0369]: cannot add `&str` to `&str`
163 --> $DIR/issue-39018.rs:37:15
168 | | `+` cannot be used to concatenate two `&str` strings
171 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
173 LL | let _ = c.to_owned() + d;
176 error: aborting due to 14 previous errors
178 Some errors have detailed explanations: E0308, E0369.
179 For more information about an error, try `rustc --explain E0308`.