1 warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
2 --> $DIR/issue-76535.rs:1:12
4 LL | #![feature(generic_associated_types)]
5 | ^^^^^^^^^^^^^^^^^^^^^^^^
7 = note: `#[warn(incomplete_features)]` on by default
8 = note: see issue #44265 <https://github.com/rust-lang/rust/issues/44265> for more information
10 error[E0107]: missing generics for associated type `SuperTrait::SubType`
11 --> $DIR/issue-76535.rs:7:10
13 LL | type SubType<'a>: SubTrait;
14 | ^^^^^^^ expected 1 lifetime argument
16 note: associated type defined here, with 1 lifetime parameter: `'a`
17 --> $DIR/issue-76535.rs:7:10
19 LL | type SubType<'a>: SubTrait;
21 help: use angle brackets to add missing lifetime argument
23 LL | type SubType<'a><'a>: SubTrait;
26 error[E0038]: the trait `SuperTrait` cannot be made into an object
27 --> $DIR/issue-76535.rs:38:14
29 LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
32 = help: consider moving `SubType` to another trait
33 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>
34 --> $DIR/issue-76535.rs:7:10
36 LL | pub trait SuperTrait {
37 | ---------- this trait cannot be made into an object...
38 LL | type SubType<'a>: SubTrait;
39 | ^^^^^^^ ...because it contains the generic associated type `SubType`
41 error[E0038]: the trait `SuperTrait` cannot be made into an object
42 --> $DIR/issue-76535.rs:38:57
44 LL | let sub: Box<dyn SuperTrait<SubType = SubStruct>> = Box::new(SuperStruct::new(0));
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `SuperTrait` cannot be made into an object
47 = help: consider moving `SubType` to another trait
48 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>
49 --> $DIR/issue-76535.rs:7:10
51 LL | pub trait SuperTrait {
52 | ---------- this trait cannot be made into an object...
53 LL | type SubType<'a>: SubTrait;
54 | ^^^^^^^ ...because it contains the generic associated type `SubType`
55 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn SuperTrait<SubType = SubStruct<'_>>>>` for `Box<SuperStruct>`
56 = note: required by cast to type `Box<dyn SuperTrait<SubType = SubStruct<'_>>>`
58 error: aborting due to 3 previous errors; 1 warning emitted
60 Some errors have detailed explanations: E0038, E0107.
61 For more information about an error, try `rustc --explain E0038`.