]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/issue-39018.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / span / issue-39018.stderr
1 error[E0369]: cannot add `&str` to `&str`
2   --> $DIR/issue-39018.rs:2:22
3    |
4 LL |     let x = "Hello " + "World!";
5    |             -------- ^ -------- &str
6    |             |        |
7    |             |        `+` cannot be used to concatenate two `&str` strings
8    |             &str
9    |
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    |                     +++++++++++
15
16 error[E0369]: cannot add `World` to `World`
17   --> $DIR/issue-39018.rs:8:26
18    |
19 LL |     let y = World::Hello + World::Goodbye;
20    |             ------------ ^ -------------- World
21    |             |
22    |             World
23    |
24 note: an implementation of `Add<_>` might be missing for `World`
25   --> $DIR/issue-39018.rs:15:1
26    |
27 LL | enum World {
28    | ^^^^^^^^^^ must implement `Add<_>`
29 note: the trait `Add` must be implemented
30   --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
31
32 error[E0369]: cannot add `String` to `&str`
33   --> $DIR/issue-39018.rs:11:22
34    |
35 LL |     let x = "Hello " + "World!".to_owned();
36    |             -------- ^ ------------------- String
37    |             |        |
38    |             |        `+` cannot be used to concatenate a `&str` with a `String`
39    |             &str
40    |
41 help: create an owned `String` on the left and add a borrow on the right
42    |
43 LL |     let x = "Hello ".to_owned() + &"World!".to_owned();
44    |                     +++++++++++   +
45
46 error[E0369]: cannot add `&String` to `&String`
47   --> $DIR/issue-39018.rs:26:16
48    |
49 LL |     let _ = &a + &b;
50    |             -- ^ -- &String
51    |             |  |
52    |             |  `+` cannot be used to concatenate two `&str` strings
53    |             &String
54    |
55    = note: string concatenation requires an owned `String` on the left
56 help: remove the borrow to obtain an owned `String`
57    |
58 LL -     let _ = &a + &b;
59 LL +     let _ = a + &b;
60    |
61
62 error[E0369]: cannot add `String` to `&String`
63   --> $DIR/issue-39018.rs:27:16
64    |
65 LL |     let _ = &a + b;
66    |             -- ^ - String
67    |             |  |
68    |             |  `+` cannot be used to concatenate a `&str` with a `String`
69    |             &String
70    |
71 help: remove the borrow on the left and add one on the right
72    |
73 LL -     let _ = &a + b;
74 LL +     let _ = a + &b;
75    |
76
77 error[E0308]: mismatched types
78   --> $DIR/issue-39018.rs:29:17
79    |
80 LL |     let _ = a + b;
81    |                 ^
82    |                 |
83    |                 expected `&str`, found struct `String`
84    |                 help: consider borrowing here: `&b`
85
86 error[E0369]: cannot add `String` to `&String`
87   --> $DIR/issue-39018.rs:30:15
88    |
89 LL |     let _ = e + b;
90    |             - ^ - String
91    |             | |
92    |             | `+` cannot be used to concatenate a `&str` with a `String`
93    |             &String
94    |
95 help: create an owned `String` on the left and add a borrow on the right
96    |
97 LL |     let _ = e.to_owned() + &b;
98    |              +++++++++++   +
99
100 error[E0369]: cannot add `&String` to `&String`
101   --> $DIR/issue-39018.rs:31:15
102    |
103 LL |     let _ = e + &b;
104    |             - ^ -- &String
105    |             | |
106    |             | `+` cannot be used to concatenate two `&str` strings
107    |             &String
108    |
109    = note: string concatenation requires an owned `String` on the left
110 help: create an owned `String` from a string reference
111    |
112 LL |     let _ = e.to_owned() + &b;
113    |              +++++++++++
114
115 error[E0369]: cannot add `&str` to `&String`
116   --> $DIR/issue-39018.rs:32:15
117    |
118 LL |     let _ = e + d;
119    |             - ^ - &str
120    |             | |
121    |             | `+` cannot be used to concatenate two `&str` strings
122    |             &String
123    |
124    = note: string concatenation requires an owned `String` on the left
125 help: create an owned `String` from a string reference
126    |
127 LL |     let _ = e.to_owned() + d;
128    |              +++++++++++
129
130 error[E0369]: cannot add `&&str` to `&String`
131   --> $DIR/issue-39018.rs:33:15
132    |
133 LL |     let _ = e + &d;
134    |             - ^ -- &&str
135    |             | |
136    |             | `+` cannot be used to concatenate two `&str` strings
137    |             &String
138    |
139    = note: string concatenation requires an owned `String` on the left
140 help: create an owned `String` from a string reference
141    |
142 LL |     let _ = e.to_owned() + &d;
143    |              +++++++++++
144
145 error[E0369]: cannot add `&&str` to `&&str`
146   --> $DIR/issue-39018.rs:34:16
147    |
148 LL |     let _ = &c + &d;
149    |             -- ^ -- &&str
150    |             |
151    |             &&str
152
153 error[E0369]: cannot add `&str` to `&&str`
154   --> $DIR/issue-39018.rs:35:16
155    |
156 LL |     let _ = &c + d;
157    |             -- ^ - &str
158    |             |
159    |             &&str
160
161 error[E0369]: cannot add `&&str` to `&str`
162   --> $DIR/issue-39018.rs:36:15
163    |
164 LL |     let _ = c + &d;
165    |             - ^ -- &&str
166    |             | |
167    |             | `+` cannot be used to concatenate two `&str` strings
168    |             &str
169    |
170    = note: string concatenation requires an owned `String` on the left
171 help: create an owned `String` from a string reference
172    |
173 LL |     let _ = c.to_owned() + &d;
174    |              +++++++++++
175
176 error[E0369]: cannot add `&str` to `&str`
177   --> $DIR/issue-39018.rs:37:15
178    |
179 LL |     let _ = c + d;
180    |             - ^ - &str
181    |             | |
182    |             | `+` cannot be used to concatenate two `&str` strings
183    |             &str
184    |
185    = note: string concatenation requires an owned `String` on the left
186 help: create an owned `String` from a string reference
187    |
188 LL |     let _ = c.to_owned() + d;
189    |              +++++++++++
190
191 error: aborting due to 14 previous errors
192
193 Some errors have detailed explanations: E0308, E0369.
194 For more information about an error, try `rustc --explain E0308`.