]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr
New upstream version 1.43.0+dfsg1
[rustc.git] / src / test / ui / type / type-parameter-defaults-referencing-Self-ppaux.stderr
CommitLineData
b7449926 1error[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
4LL | let y = x as dyn MyAdd<i32>;
5 | ^^^^^^^^^^^^^^^^^^^
b7449926
XL
6 |
7help: consider using a box or reference as appropriate
0731742a 8 --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:14:13
b7449926 9 |
dc9dc135 10LL | let y = x as dyn MyAdd<i32>;
b7449926
XL
11 | ^
12
13error[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 16LL | 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
21LL | 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
26error: aborting due to 2 previous errors
27
48663c56 28Some errors have detailed explanations: E0038, E0620.
b7449926 29For more information about an error, try `rustc --explain E0038`.