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 trait `Add` must be implemented
30 --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
32 error[E0369]: cannot add `String` to `&str`
33 --> $DIR/issue-39018.rs:11:22
35 LL | let x = "Hello " + "World!".to_owned();
36 | -------- ^ ------------------- String
38 | | `+` cannot be used to concatenate a `&str` with a `String`
41 help: create an owned `String` on the left and add a borrow on the right
43 LL | let x = "Hello ".to_owned() + &"World!".to_owned();
46 error[E0369]: cannot add `&String` to `&String`
47 --> $DIR/issue-39018.rs:26:16
52 | | `+` cannot be used to concatenate two `&str` strings
55 = note: string concatenation requires an owned `String` on the left
56 help: remove the borrow to obtain an owned `String`
62 error[E0369]: cannot add `String` to `&String`
63 --> $DIR/issue-39018.rs:27:16
68 | | `+` cannot be used to concatenate a `&str` with a `String`
71 help: remove the borrow on the left and add one on the right
77 error[E0308]: mismatched types
78 --> $DIR/issue-39018.rs:29:17
83 | expected `&str`, found `String`
84 | help: consider borrowing here: `&b`
86 error[E0369]: cannot add `String` to `&String`
87 --> $DIR/issue-39018.rs:30:15
92 | | `+` cannot be used to concatenate a `&str` with a `String`
95 help: create an owned `String` on the left and add a borrow on the right
97 LL | let _ = e.to_owned() + &b;
100 error[E0369]: cannot add `&String` to `&String`
101 --> $DIR/issue-39018.rs:31:15
106 | | `+` cannot be used to concatenate two `&str` strings
109 = note: string concatenation requires an owned `String` on the left
110 help: create an owned `String` from a string reference
112 LL | let _ = e.to_owned() + &b;
115 error[E0369]: cannot add `&str` to `&String`
116 --> $DIR/issue-39018.rs:32:15
121 | | `+` cannot be used to concatenate two `&str` strings
124 = note: string concatenation requires an owned `String` on the left
125 help: create an owned `String` from a string reference
127 LL | let _ = e.to_owned() + d;
130 error[E0369]: cannot add `&&str` to `&String`
131 --> $DIR/issue-39018.rs:33:15
136 | | `+` cannot be used to concatenate two `&str` strings
139 = note: string concatenation requires an owned `String` on the left
140 help: create an owned `String` from a string reference
142 LL | let _ = e.to_owned() + &d;
145 error[E0369]: cannot add `&&str` to `&&str`
146 --> $DIR/issue-39018.rs:34:16
148 LL | let _ = &c + &d;
153 error[E0369]: cannot add `&str` to `&&str`
154 --> $DIR/issue-39018.rs:35:16
161 error[E0369]: cannot add `&&str` to `&str`
162 --> $DIR/issue-39018.rs:36:15
167 | | `+` cannot be used to concatenate two `&str` strings
170 = note: string concatenation requires an owned `String` on the left
171 help: create an owned `String` from a string reference
173 LL | let _ = c.to_owned() + &d;
176 error[E0369]: cannot add `&str` to `&str`
177 --> $DIR/issue-39018.rs:37:15
182 | | `+` cannot be used to concatenate two `&str` strings
185 = note: string concatenation requires an owned `String` on the left
186 help: create an owned `String` from a string reference
188 LL | let _ = c.to_owned() + d;
191 error: aborting due to 14 previous errors
193 Some errors have detailed explanations: E0308, E0369.
194 For more information about an error, try `rustc --explain E0308`.