1 error[E0620]: cast to unsized type: `i32` as `dyn MyAdd<i32>`
2 --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13
4 LL | let y = x as dyn MyAdd<i32>;
7 help: consider using a box or reference as appropriate
8 --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13
10 LL | let y = x as dyn MyAdd<i32>;
13 error[E0038]: the trait `MyAdd` cannot be made into an object
14 --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:18
16 LL | let y = x as dyn MyAdd<i32>;
17 | ^^^^^^^^^^^^^^ `MyAdd` cannot be made into an object
19 note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
20 --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:6:55
22 LL | trait MyAdd<Rhs=Self> { fn add(&self, other: &Rhs) -> Self; }
23 | ----- ^^^^ ...because method `add` references the `Self` type in its return type
25 | this trait cannot be made into an object...
26 = help: consider moving `add` to another trait
28 error: aborting due to 2 previous errors
30 Some errors have detailed explanations: E0038, E0620.
31 For more information about an error, try `rustc --explain E0038`.