1 error[E0107]: missing generics for associated type `MapLike::VRefCont`
2 --> $DIR/issue-79422.rs:42:36
4 LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
5 | ^^^^^^^^ expected 1 lifetime argument
7 note: associated type defined here, with 1 lifetime parameter: `'a`
8 --> $DIR/issue-79422.rs:20:10
10 LL | type VRefCont<'a>: RefCont<'a, V>;
12 help: add missing lifetime argument
14 LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
17 error[E0038]: the trait `MapLike` cannot be made into an object
18 --> $DIR/issue-79422.rs:42:12
20 LL | as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object
23 = help: consider moving `VRefCont` 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-79422.rs:20:10
27 LL | trait MapLike<K, V> {
28 | ------- this trait cannot be made into an object...
29 LL | type VRefCont<'a>: RefCont<'a, V>;
30 | ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
32 error[E0038]: the trait `MapLike` cannot be made into an object
33 --> $DIR/issue-79422.rs:41:13
35 LL | let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MapLike` cannot be made into an object
38 = help: consider moving `VRefCont` 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-79422.rs:20:10
42 LL | trait MapLike<K, V> {
43 | ------- this trait cannot be made into an object...
44 LL | type VRefCont<'a>: RefCont<'a, V>;
45 | ^^^^^^^^ ...because it contains the generic associated type `VRefCont`
46 = note: required because of the requirements on the impl of `CoerceUnsized<Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>>` for `Box<BTreeMap<u8, u8>>`
47 = note: required by cast to type `Box<dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>>`
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`.