]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | error[E0620]: cast to unsized type: `i32` as `dyn MyAdd<i32>` |
0731742a | 2 | --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13 |
b7449926 | 3 | | |
dc9dc135 XL |
4 | LL | let y = x as dyn MyAdd<i32>; |
5 | | ^^^^^^^^^^^^^^^^^^^ | |
b7449926 XL |
6 | | |
7 | help: consider using a box or reference as appropriate | |
0731742a | 8 | --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13 |
b7449926 | 9 | | |
dc9dc135 | 10 | LL | let y = x as dyn MyAdd<i32>; |
b7449926 XL |
11 | | ^ |
12 | ||
13 | error[E0038]: the trait `MyAdd` cannot be made into an object | |
0731742a | 14 | --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:18 |
b7449926 | 15 | | |
e1599b0c | 16 | LL | trait MyAdd<Rhs=Self> { fn add(&self, other: &Rhs) -> Self; } |
74b04a01 XL |
17 | | ----- ---- ...because method `add` references the `Self` type in its return type |
18 | | | | |
19 | | this trait cannot be made into an object... | |
e1599b0c | 20 | ... |
dc9dc135 XL |
21 | LL | let y = x as dyn MyAdd<i32>; |
22 | | ^^^^^^^^^^^^^^ the trait `MyAdd` cannot be made into an object | |
74b04a01 XL |
23 | | |
24 | = help: consider moving `add` to another trait | |
b7449926 XL |
25 | |
26 | error: aborting due to 2 previous errors | |
27 | ||
48663c56 | 28 | Some errors have detailed explanations: E0038, E0620. |
b7449926 | 29 | For more information about an error, try `rustc --explain E0038`. |