]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-78671.stderr
Auto merge of #87150 - rusticstuff:simplify_wrapping_neg, r=m-ou-se
[rust.git] / src / test / ui / generic-associated-types / issue-78671.stderr
1 error[E0107]: missing generics for associated type `CollectionFamily::Member`
2   --> $DIR/issue-78671.rs:7:47
3    |
4 LL |     Box::new(Family) as &dyn CollectionFamily<Member=usize>
5    |                                               ^^^^^^ expected 1 generic argument
6    |
7 note: associated type defined here, with 1 generic parameter: `T`
8   --> $DIR/issue-78671.rs:4:10
9    |
10 LL |     type Member<T>;
11    |          ^^^^^^ -
12 help: add missing generic argument
13    |
14 LL |     Box::new(Family) as &dyn CollectionFamily<Member<T>=usize>
15    |                                               ^^^^^^^^^
16
17 error[E0038]: the trait `CollectionFamily` cannot be made into an object
18   --> $DIR/issue-78671.rs:7:25
19    |
20 LL |     Box::new(Family) as &dyn CollectionFamily<Member=usize>
21    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `CollectionFamily` cannot be made into an object
22    |
23    = help: consider moving `Member` 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-78671.rs:4:10
26    |
27 LL | trait CollectionFamily {
28    |       ---------------- this trait cannot be made into an object...
29 LL |     type Member<T>;
30    |          ^^^^^^ ...because it contains the generic associated type `Member`
31
32 error: aborting due to 2 previous errors
33
34 Some errors have detailed explanations: E0038, E0107.
35 For more information about an error, try `rustc --explain E0038`.