]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/alias/object-fail.stderr
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / traits / alias / object-fail.stderr
CommitLineData
1b1a35ee 1error[E0038]: the trait `Eq` cannot be made into an object
6a06907d 2 --> $DIR/object-fail.rs:7:13
a1dfa0c6 3 |
532ac7d7 4LL | let _: &dyn EqAlias = &123;
29967ef6
XL
5 | ^^^^^^^^^^^ `Eq` cannot be made into an object
6 |
7note: 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 10LL | 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 13error[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 16LL | let _: &dyn IteratorAlias = &vec![123].into_iter();
dfeec247 17 | ^^^^^^^^^^^^^ help: specify the associated type: `IteratorAlias<Item = Type>`
a1dfa0c6
XL
18
19error: aborting due to 2 previous errors
20
48663c56 21Some errors have detailed explanations: E0038, E0191.
a1dfa0c6 22For more information about an error, try `rustc --explain E0038`.