2018-08-08 12:28:26 +00:00
error[E0308]: mismatched types
2018-12-25 15:56:47 +00:00
--> $DIR/dst-bad-assign-3.rs:33:12
2018-08-08 12:28:26 +00:00
|
LL | f5.2 = Bar1 {f: 36};
2023-01-03 02:00:33 +00:00
| ---- ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1`
2021-05-07 02:09:35 +00:00
| |
| expected due to the type of this binding
2018-08-08 12:28:26 +00:00
|
2019-11-14 22:08:08 +00:00
= note: expected trait object `dyn ToBar`
found struct `Bar1`
2024-01-24 16:30:37 +00:00
= help: `Bar1` implements `ToBar` so you could box the found value and coerce it to the trait object `Box<dyn ToBar>`, you will have to change the expected type as well
2018-08-08 12:28:26 +00:00
error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time
2018-12-25 15:56:47 +00:00
--> $DIR/dst-bad-assign-3.rs:33:5
2018-08-08 12:28:26 +00:00
|
LL | f5.2 = Bar1 {f: 36};
| ^^^^ doesn't have a size known at compile-time
|
2020-09-02 07:40:56 +00:00
= help: the trait `Sized` is not implemented for `dyn ToBar`
2018-08-08 12:28:26 +00:00
= note: the left-hand-side of an assignment must have a statically known size
error: aborting due to 2 previous errors
2019-04-17 17:26:38 +00:00
Some errors have detailed explanations: E0277, E0308.
2018-08-08 12:28:26 +00:00
For more information about an error, try `rustc --explain E0277`.