You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| ------------ ^^ expected `Box<{integer}>`, found integer
231
+
| |
232
+
| expected because this is `Box<{integer}>`
233
+
|
234
+
= note: expected struct `Box<{integer}>`
235
+
found type `{integer}`
236
+
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
237
+
help: store this in the heap by calling `Box::new`
238
+
|
239
+
LL | _ = Box::new(42) == Box::new(42);
240
+
| +++++++++ +
241
+
242
+
error[E0277]: can't compare `&&{integer}` with `Foo`
243
+
--> $DIR/binary-op-suggest-deref.rs:58:13
244
+
|
245
+
LL | _ = &&0 == Foo;
246
+
| ^^ no implementation for `&&{integer} == Foo`
247
+
|
248
+
= help: the trait `PartialEq<Foo>` is not implemented for `&&{integer}`
249
+
= help: the following other types implement trait `PartialEq<Rhs>`:
250
+
isize
251
+
i8
252
+
i16
253
+
i32
254
+
i64
255
+
i128
256
+
usize
257
+
u8
258
+
and 6 others
259
+
260
+
error[E0369]: binary operation `==` cannot be applied to type `Foo`
261
+
--> $DIR/binary-op-suggest-deref.rs:60:13
262
+
|
263
+
LL | _ = Foo == &&0;
264
+
| --- ^^ --- &&{integer}
265
+
| |
266
+
| Foo
267
+
|
268
+
note: an implementation of `PartialEq<&&{integer}>` might be missing for `Foo`
269
+
--> $DIR/binary-op-suggest-deref.rs:57:5
270
+
|
271
+
LL | struct Foo;
272
+
| ^^^^^^^^^^ must implement `PartialEq<&&{integer}>`
273
+
help: consider annotating `Foo` with `#[derive(PartialEq)]`
274
+
|
275
+
LL + #[derive(PartialEq)]
276
+
LL | struct Foo;
277
+
|
278
+
279
+
error[E0277]: can't compare `&String` with `str`
280
+
--> $DIR/binary-op-suggest-deref.rs:69:20
281
+
|
282
+
LL | _ = string_ref == partial[..3];
283
+
| ^^ no implementation for `&String == str`
284
+
|
285
+
= help: the trait `PartialEq<str>` is not implemented for `&String`
286
+
help: consider dereferencing here
287
+
|
288
+
LL | _ = *string_ref == partial[..3];
289
+
| +
290
+
291
+
error[E0277]: can't compare `str` with `&String`
292
+
--> $DIR/binary-op-suggest-deref.rs:71:22
293
+
|
294
+
LL | _ = partial[..3] == string_ref;
295
+
| ^^ no implementation for `str == &String`
296
+
|
297
+
= help: the trait `PartialEq<&String>` is not implemented for `str`
298
+
help: consider dereferencing here
299
+
|
300
+
LL | _ = partial[..3] == *string_ref;
301
+
| +
302
+
303
+
error: aborting due to 22 previous errors
13
304
14
-
For more information about this error, try `rustc --explain E0308`.
305
+
Some errors have detailed explanations: E0277, E0308, E0369.
306
+
For more information about an error, try `rustc --explain E0277`.
0 commit comments