]>
Commit | Line | Data |
---|---|---|
1b1a35ee | 1 | error[E0038]: the trait `Eq` cannot be made into an object |
6a06907d | 2 | --> $DIR/object-fail.rs:7:13 |
a1dfa0c6 | 3 | | |
532ac7d7 | 4 | LL | let _: &dyn EqAlias = &123; |
29967ef6 XL |
5 | | ^^^^^^^^^^^ `Eq` cannot be made into an object |
6 | | | |
7 | 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> | |
8 | --> $SRC_DIR/core/src/cmp.rs:LL:COL | |
a1dfa0c6 | 9 | | |
74b04a01 | 10 | LL | pub trait Eq: PartialEq<Self> { |
29967ef6 | 11 | | ^^^^^^^^^^^^^^^ the trait cannot be made into an object because it uses `Self` as a type parameter |
a1dfa0c6 | 12 | |
1b1a35ee | 13 | error[E0191]: the value of the associated type `Item` (from trait `Iterator`) must be specified |
6a06907d | 14 | --> $DIR/object-fail.rs:9:17 |
a1dfa0c6 | 15 | | |
532ac7d7 | 16 | LL | let _: &dyn IteratorAlias = &vec![123].into_iter(); |
dfeec247 | 17 | | ^^^^^^^^^^^^^ help: specify the associated type: `IteratorAlias<Item = Type>` |
a1dfa0c6 XL |
18 | |
19 | error: aborting due to 2 previous errors | |
20 | ||
48663c56 | 21 | Some errors have detailed explanations: E0038, E0191. |
a1dfa0c6 | 22 | For more information about an error, try `rustc --explain E0038`. |