]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-79422.extended.stderr
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-79422.extended.stderr
1 error[E0107]: missing generics for associated type `MapLike::VRefCont`
2   --> $DIR/issue-79422.rs:48:36
3    |
4 LL |         as Box<dyn MapLike<u8, u8, VRefCont = dyn RefCont<'_, u8>>>;
5    |                                    ^^^^^^^^ expected 1 lifetime argument
6    |
7 note: associated type defined here, with 1 lifetime parameter: `'a`
8   --> $DIR/issue-79422.rs:24:10
9    |
10 LL |     type VRefCont<'a>: RefCont<'a, V> where Self: 'a;
11    |          ^^^^^^^^ --
12 help: add missing lifetime argument
13    |
14 LL |         as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
15    |                                    ~~~~~~~~~~~~
16
17 error[E0271]: type mismatch resolving `<BTreeMap<u8, u8> as MapLike<u8, u8>>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)`
18   --> $DIR/issue-79422.rs:45:13
19    |
20 LL |     let m = Box::new(std::collections::BTreeMap::<u8, u8>::new())
21    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<BTreeMap<u8, u8> as MapLike<u8, u8>>::VRefCont<'_> == (dyn RefCont<'_, u8> + 'static)`
22    |
23 note: expected this to be `(dyn RefCont<'_, u8> + 'static)`
24   --> $DIR/issue-79422.rs:29:25
25    |
26 LL |     type VRefCont<'a> = &'a V where Self: 'a;
27    |                         ^^^^^
28    = note: expected trait object `(dyn RefCont<'_, u8> + 'static)`
29                  found reference `&u8`
30    = note: required for the cast from `BTreeMap<u8, u8>` to the object type `dyn MapLike<u8, u8, VRefCont = (dyn RefCont<'_, u8> + 'static)>`
31
32 error: aborting due to 2 previous errors
33
34 Some errors have detailed explanations: E0107, E0271.
35 For more information about an error, try `rustc --explain E0107`.