trait bounds were not satisfied
--> src/vm/atom.rs:41:64
|
41 | (Tag::Obj, Tag::Obj) => unsafe { (&*self.as_obj()).partial_cmp(&*other.as_obj()) },
| ^^^^^^^^^^^ method cannot be called on `&Object` due to unsatisfied trait bounds
...
202 | pub struct Object {
| -----------------
| |
| doesn't satisfy `Object: Iterator`
| doesn't satisfy `Object: PartialOrd<_>`
|
note: the following trait bounds were not satisfied because of the requirements of the implementation of `PartialOrd<_>` for `_`:
`Object: PartialOrd<_>`
--> src/vm/atom.rs:22:6
|
22 | impl PartialOrd for Atom {
| ^^^^^^^^^^ ^^^^
= note: the following trait bounds were not satisfied:
`&Object: Iterator`
which is required by `&mut &Object: Iterator`
`Object: Iterator`
which is required by `&mut Object: Iterator`
note: the following trait must be implemented
--> /home/johnd/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:56:1
|
56 | / pub trait Iterator {
57 | | /// The type of the elements being iterated over.
58 | | #[stable(feature = "rust1", since = "1.0.0")]
59 | | type Item;
... |
3672 | | }
3673 | | }
| |_^
help: consider annotating `Object` with `#[derive(PartialEq, PartialOrd)]`
|
202 | #[derive(PartialEq, PartialOrd)]
|
For more information about this error, try `rustc --explain E0599`.
Объясните, откуда взялся баунд Object: Iterator? В коде его нигде нет, вся ошибка на практике в том что Object: !PartialOrd
кто-то сделал импл Ord с баундом Iterator, навеное
Cуществует метод Iterator::partial_cmp
Обсуждают сегодня