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 = note: string concatenation requires an owned `String` on the left
11 help: create an owned `String` from a string reference
13 LL | let x = "Hello ".to_owned() + "World!";
16 error[E0369]: cannot add `World` to `World`
17 --> $DIR/issue-39018.rs:8:26
19 LL | let y = World::Hello + World::Goodbye;
20 | ------------ ^ -------------- World
24 note: an implementation of `Add<_>` might be missing for `World`
25 --> $DIR/issue-39018.rs:15:1
28 | ^^^^^^^^^^ must implement `Add<_>`
29 note: the following trait must be implemented
30 --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
32 LL | pub trait Add<Rhs = Self> {
33 | ^^^^^^^^^^^^^^^^^^^^^^^^^
35 error[E0369]: cannot add `String` to `&str`
36 --> $DIR/issue-39018.rs:11:22
38 LL | let x = "Hello " + "World!".to_owned();
39 | -------- ^ ------------------- String
41 | | `+` cannot be used to concatenate a `&str` with a `String`
44 help: create an owned `String` on the left and add a borrow on the right
46 LL | let x = "Hello ".to_owned() + &"World!".to_owned();
49 error[E0369]: cannot add `&String` to `&String`
50 --> $DIR/issue-39018.rs:26:16
55 | | `+` cannot be used to concatenate two `&str` strings
58 = note: string concatenation requires an owned `String` on the left
59 help: remove the borrow to obtain an owned `String`
65 error[E0369]: cannot add `String` to `&String`
66 --> $DIR/issue-39018.rs:27:16
71 | | `+` cannot be used to concatenate a `&str` with a `String`
74 help: remove the borrow on the left and add one on the right
80 error[E0308]: mismatched types
81 --> $DIR/issue-39018.rs:29:17
86 | expected `&str`, found struct `String`
87 | help: consider borrowing here: `&b`
89 error[E0369]: cannot add `String` to `&String`
90 --> $DIR/issue-39018.rs:30:15
95 | | `+` cannot be used to concatenate a `&str` with a `String`
98 help: create an owned `String` on the left and add a borrow on the right
100 LL | let _ = e.to_owned() + &b;
103 error[E0369]: cannot add `&String` to `&String`
104 --> $DIR/issue-39018.rs:31:15
109 | | `+` cannot be used to concatenate two `&str` strings
112 = note: string concatenation requires an owned `String` on the left
113 help: create an owned `String` from a string reference
115 LL | let _ = e.to_owned() + &b;
118 error[E0369]: cannot add `&str` to `&String`
119 --> $DIR/issue-39018.rs:32:15
124 | | `+` cannot be used to concatenate two `&str` strings
127 = note: string concatenation requires an owned `String` on the left
128 help: create an owned `String` from a string reference
130 LL | let _ = e.to_owned() + d;
133 error[E0369]: cannot add `&&str` to `&String`
134 --> $DIR/issue-39018.rs:33:15
139 | | `+` cannot be used to concatenate two `&str` strings
142 = note: string concatenation requires an owned `String` on the left
143 help: create an owned `String` from a string reference
145 LL | let _ = e.to_owned() + &d;
148 error[E0369]: cannot add `&&str` to `&&str`
149 --> $DIR/issue-39018.rs:34:16
151 LL | let _ = &c + &d;
156 error[E0369]: cannot add `&str` to `&&str`
157 --> $DIR/issue-39018.rs:35:16
164 error[E0369]: cannot add `&&str` to `&str`
165 --> $DIR/issue-39018.rs:36:15
170 | | `+` cannot be used to concatenate two `&str` strings
173 = note: string concatenation requires an owned `String` on the left
174 help: create an owned `String` from a string reference
176 LL | let _ = c.to_owned() + &d;
179 error[E0369]: cannot add `&str` to `&str`
180 --> $DIR/issue-39018.rs:37:15
185 | | `+` cannot be used to concatenate two `&str` strings
188 = note: string concatenation requires an owned `String` on the left
189 help: create an owned `String` from a string reference
191 LL | let _ = c.to_owned() + d;
194 error: aborting due to 14 previous errors
196 Some errors have detailed explanations: E0308, E0369.
197 For more information about an error, try `rustc --explain E0308`.