@@ -2,13 +2,16 @@ error[E0369]: cannot add `&str` to `&str`
2
2
--> $DIR/issue-39018.rs:2:22
3
3
|
4
4
LL | let x = "Hello " + "World!";
5
- | ---------^ -------- &str
6
- | | ||
7
- | | |`+` cannot be used to concatenate two `&str` strings
8
- | | help: create an owned `String` from a string reference: `.to_owned()`
5
+ | -------- ^ -------- &str
6
+ | | |
7
+ | | `+` cannot be used to concatenate two `&str` strings
9
8
| &str
10
9
|
11
10
= note: string concatenation requires an owned `String` on the left
11
+ help: create an owned `String` from a string reference
12
+ |
13
+ LL | let x = "Hello ".to_owned() + "World!";
14
+ | +++++++++++
12
15
13
16
error[E0369]: cannot add `World` to `World`
14
17
--> $DIR/issue-39018.rs:8:26
@@ -57,9 +60,13 @@ LL | let _ = &a + &b;
57
60
| | |
58
61
| | `+` cannot be used to concatenate two `&str` strings
59
62
| &String
60
- | help: remove the borrow to obtain an owned `String`
61
63
|
62
64
= note: string concatenation requires an owned `String` on the left
65
+ help: remove the borrow to obtain an owned `String`
66
+ |
67
+ LL - let _ = &a + &b;
68
+ LL + let _ = a + &b;
69
+ |
63
70
64
71
error[E0369]: cannot add `String` to `&String`
65
72
--> $DIR/issue-39018.rs:27:16
@@ -103,37 +110,46 @@ error[E0369]: cannot add `&String` to `&String`
103
110
--> $DIR/issue-39018.rs:31:15
104
111
|
105
112
LL | let _ = e + &b;
106
- | --^ -- &String
107
- | |||
108
- | ||`+` cannot be used to concatenate two `&str` strings
109
- | |help: create an owned `String` from a string reference: `.to_owned()`
113
+ | - ^ -- &String
114
+ | | |
115
+ | | `+` cannot be used to concatenate two `&str` strings
110
116
| &String
111
117
|
112
118
= note: string concatenation requires an owned `String` on the left
119
+ help: create an owned `String` from a string reference
120
+ |
121
+ LL | let _ = e.to_owned() + &b;
122
+ | +++++++++++
113
123
114
124
error[E0369]: cannot add `&str` to `&String`
115
125
--> $DIR/issue-39018.rs:32:15
116
126
|
117
127
LL | let _ = e + d;
118
- | --^ - &str
119
- | |||
120
- | ||`+` cannot be used to concatenate two `&str` strings
121
- | |help: create an owned `String` from a string reference: `.to_owned()`
128
+ | - ^ - &str
129
+ | | |
130
+ | | `+` cannot be used to concatenate two `&str` strings
122
131
| &String
123
132
|
124
133
= note: string concatenation requires an owned `String` on the left
134
+ help: create an owned `String` from a string reference
135
+ |
136
+ LL | let _ = e.to_owned() + d;
137
+ | +++++++++++
125
138
126
139
error[E0369]: cannot add `&&str` to `&String`
127
140
--> $DIR/issue-39018.rs:33:15
128
141
|
129
142
LL | let _ = e + &d;
130
- | --^ -- &&str
131
- | |||
132
- | ||`+` cannot be used to concatenate two `&str` strings
133
- | |help: create an owned `String` from a string reference: `.to_owned()`
143
+ | - ^ -- &&str
144
+ | | |
145
+ | | `+` cannot be used to concatenate two `&str` strings
134
146
| &String
135
147
|
136
148
= note: string concatenation requires an owned `String` on the left
149
+ help: create an owned `String` from a string reference
150
+ |
151
+ LL | let _ = e.to_owned() + &d;
152
+ | +++++++++++
137
153
138
154
error[E0369]: cannot add `&&str` to `&&str`
139
155
--> $DIR/issue-39018.rs:34:16
@@ -155,25 +171,31 @@ error[E0369]: cannot add `&&str` to `&str`
155
171
--> $DIR/issue-39018.rs:36:15
156
172
|
157
173
LL | let _ = c + &d;
158
- | --^ -- &&str
159
- | |||
160
- | ||`+` cannot be used to concatenate two `&str` strings
161
- | |help: create an owned `String` from a string reference: `.to_owned()`
174
+ | - ^ -- &&str
175
+ | | |
176
+ | | `+` cannot be used to concatenate two `&str` strings
162
177
| &str
163
178
|
164
179
= note: string concatenation requires an owned `String` on the left
180
+ help: create an owned `String` from a string reference
181
+ |
182
+ LL | let _ = c.to_owned() + &d;
183
+ | +++++++++++
165
184
166
185
error[E0369]: cannot add `&str` to `&str`
167
186
--> $DIR/issue-39018.rs:37:15
168
187
|
169
188
LL | let _ = c + d;
170
- | --^ - &str
171
- | |||
172
- | ||`+` cannot be used to concatenate two `&str` strings
173
- | |help: create an owned `String` from a string reference: `.to_owned()`
189
+ | - ^ - &str
190
+ | | |
191
+ | | `+` cannot be used to concatenate two `&str` strings
174
192
| &str
175
193
|
176
194
= note: string concatenation requires an owned `String` on the left
195
+ help: create an owned `String` from a string reference
196
+ |
197
+ LL | let _ = c.to_owned() + d;
198
+ | +++++++++++
177
199
178
200
error: aborting due to 14 previous errors
179
201
0 commit comments