1 error[E0107]: missing generics for associated type `SuperTrait::SubType`
2 --> $DIR/issue-76535.rs:36:33
4 LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
5 | ^^^^^^^ expected 1 lifetime argument
7 note: associated type defined here, with 1 lifetime parameter: `'a`
8 --> $DIR/issue-76535.rs:6:10
10 LL | type SubType<'a>: SubTrait;
12 help: add missing lifetime argument
14 LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperStruct::new(0));
17 error[E0038]: the trait `SuperTrait` cannot be made into an object
18 --> $DIR/issue-76535.rs:36:14
20 LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
23 = help: consider moving `SubType` to another trait
24 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>
25 --> $DIR/issue-76535.rs:6:10
27 LL | pub trait SuperTrait {
28 | ---------- this trait cannot be made into an object...
29 LL | type SubType<'a>: SubTrait;
30 | ^^^^^^^ ...because it contains the generic associated type `SubType`
32 error[E0038]: the trait `SuperTrait` cannot be made into an object
33 --> $DIR/issue-76535.rs:36:57
35 LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
38 = help: consider moving `SubType` to another trait
39 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>
40 --> $DIR/issue-76535.rs:6:10
42 LL | pub trait SuperTrait {
43 | ---------- this trait cannot be made into an object...
44 LL | type SubType<'a>: SubTrait;
45 | ^^^^^^^ ...because it contains the generic associated type `SubType`
46 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>` for `Box<SuperStruct>`
47 = note: required by cast to type `Box<dyn SuperTrait<SubType = SubStruct<'_>>>`
49 error: aborting due to 3 previous errors
51 Some errors have detailed explanations: E0038, E0107.
52 For more information about an error, try `rustc --explain E0038`.