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