@@ -2,18 +2,13 @@ error[E0369]: cannot add `&str` to `&str`
22 --> $DIR/issue-39018.rs:2:22
33 |
44LL | let x = "Hello " + "World!";
5- | -------- ^ -------- &str
6- | | |
7- | | `+` cannot be used to concatenate two `&str` strings
5+ | ---------^ -------- &str
6+ | | ||
7+ | | |`+` cannot be used to concatenate two `&str` strings
8+ | | help: create an owned `String` from a string reference: `.to_owned()`
89 | &str
910 |
10- = note: String concatenation appends the string on the right to the
11- string on the left and may require reallocation.
12- This requires ownership of the string on the left.
13- help: use `to_owned()` to create an owned `String` from a string reference
14- |
15- LL | let x = "Hello ".to_owned() + "World!";
16- | +++++++++++
11+ = note: string concatenation requires an owned `String` on the left
1712
1813error[E0369]: cannot add `World` to `World`
1914 --> $DIR/issue-39018.rs:8:26
@@ -49,7 +44,7 @@ LL | let x = "Hello " + "World!".to_owned();
4944 | | `+` cannot be used to concatenate a `&str` with a `String`
5045 | &str
5146 |
52- help: call `.to_owned() ` on the left and add a borrow on the right
47+ help: create an owned `String ` on the left and add a borrow on the right
5348 |
5449LL | let x = "Hello ".to_owned() + &"World!".to_owned();
5550 | +++++++++++ +
@@ -64,9 +59,7 @@ LL | let _ = &a + &b;
6459 | &String
6560 | help: remove the borrow to obtain an owned `String`
6661 |
67- = note: String concatenation appends the string on the right to the
68- string on the left and may require reallocation.
69- This requires ownership of the string on the left.
62+ = note: string concatenation requires an owned `String` on the left
7063
7164error[E0369]: cannot add `String` to `&String`
7265 --> $DIR/issue-39018.rs:27:16
@@ -101,7 +94,7 @@ LL | let _ = e + b;
10194 | | `+` cannot be used to concatenate a `&str` with a `String`
10295 | &String
10396 |
104- help: call `.to_owned() ` on the left and add a borrow on the right
97+ help: create an owned `String ` on the left and add a borrow on the right
10598 |
10699LL | let _ = e.to_owned() + &b;
107100 | +++++++++++ +
@@ -110,52 +103,37 @@ error[E0369]: cannot add `&String` to `&String`
110103 --> $DIR/issue-39018.rs:31:15
111104 |
112105LL | let _ = e + &b;
113- | - ^ -- &String
114- | | |
115- | | `+` cannot be used to concatenate two `&str` strings
106+ | --^ -- &String
107+ | |||
108+ | ||`+` cannot be used to concatenate two `&str` strings
109+ | |help: create an owned `String` from a string reference: `.to_owned()`
116110 | &String
117111 |
118- = note: String concatenation appends the string on the right to the
119- string on the left and may require reallocation.
120- This requires ownership of the string on the left.
121- help: use `to_owned()` to create an owned `String` from a string reference
122- |
123- LL | let _ = e.to_owned() + &b;
124- | +++++++++++
112+ = note: string concatenation requires an owned `String` on the left
125113
126114error[E0369]: cannot add `&str` to `&String`
127115 --> $DIR/issue-39018.rs:32:15
128116 |
129117LL | let _ = e + d;
130- | - ^ - &str
131- | | |
132- | | `+` cannot be used to concatenate two `&str` strings
118+ | --^ - &str
119+ | |||
120+ | ||`+` cannot be used to concatenate two `&str` strings
121+ | |help: create an owned `String` from a string reference: `.to_owned()`
133122 | &String
134123 |
135- = note: String concatenation appends the string on the right to the
136- string on the left and may require reallocation.
137- This requires ownership of the string on the left.
138- help: use `to_owned()` to create an owned `String` from a string reference
139- |
140- LL | let _ = e.to_owned() + d;
141- | +++++++++++
124+ = note: string concatenation requires an owned `String` on the left
142125
143126error[E0369]: cannot add `&&str` to `&String`
144127 --> $DIR/issue-39018.rs:33:15
145128 |
146129LL | let _ = e + &d;
147- | - ^ -- &&str
148- | | |
149- | | `+` cannot be used to concatenate two `&str` strings
130+ | --^ -- &&str
131+ | |||
132+ | ||`+` cannot be used to concatenate two `&str` strings
133+ | |help: create an owned `String` from a string reference: `.to_owned()`
150134 | &String
151135 |
152- = note: String concatenation appends the string on the right to the
153- string on the left and may require reallocation.
154- This requires ownership of the string on the left.
155- help: use `to_owned()` to create an owned `String` from a string reference
156- |
157- LL | let _ = e.to_owned() + &d;
158- | +++++++++++
136+ = note: string concatenation requires an owned `String` on the left
159137
160138error[E0369]: cannot add `&&str` to `&&str`
161139 --> $DIR/issue-39018.rs:34:16
@@ -177,35 +155,25 @@ error[E0369]: cannot add `&&str` to `&str`
177155 --> $DIR/issue-39018.rs:36:15
178156 |
179157LL | let _ = c + &d;
180- | - ^ -- &&str
181- | | |
182- | | `+` cannot be used to concatenate two `&str` strings
158+ | --^ -- &&str
159+ | |||
160+ | ||`+` cannot be used to concatenate two `&str` strings
161+ | |help: create an owned `String` from a string reference: `.to_owned()`
183162 | &str
184163 |
185- = note: String concatenation appends the string on the right to the
186- string on the left and may require reallocation.
187- This requires ownership of the string on the left.
188- help: use `to_owned()` to create an owned `String` from a string reference
189- |
190- LL | let _ = c.to_owned() + &d;
191- | +++++++++++
164+ = note: string concatenation requires an owned `String` on the left
192165
193166error[E0369]: cannot add `&str` to `&str`
194167 --> $DIR/issue-39018.rs:37:15
195168 |
196169LL | let _ = c + d;
197- | - ^ - &str
198- | | |
199- | | `+` cannot be used to concatenate two `&str` strings
170+ | --^ - &str
171+ | |||
172+ | ||`+` cannot be used to concatenate two `&str` strings
173+ | |help: create an owned `String` from a string reference: `.to_owned()`
200174 | &str
201175 |
202- = note: String concatenation appends the string on the right to the
203- string on the left and may require reallocation.
204- This requires ownership of the string on the left.
205- help: use `to_owned()` to create an owned `String` from a string reference
206- |
207- LL | let _ = c.to_owned() + d;
208- | +++++++++++
176+ = note: string concatenation requires an owned `String` on the left
209177
210178error: aborting due to 14 previous errors
211179
0 commit comments