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