Connicpu / mtproto-rs

Other
14 stars 4 forks source link

Updates to serde_mtproto have broken mtproto-rs #11

Open habnabit opened 6 years ago

habnabit commented 6 years ago

Here's a couple of errors, but there might be more that become visible after fixing the first few:

error[E0046]: not all trait items implemented, missing: `all_type_ids`
  --> src/tl/dynamic.rs:59:1
   |
59 | impl<'a> Identifiable for &'a TLObject {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `all_type_ids` in implementation
   |
   = note: `all_type_ids` from trait: `fn() -> &'static [u32]`

error[E0046]: not all trait items implemented, missing: `all_type_ids`
  --> src/tl/dynamic.rs:77:1
   |
77 | impl Identifiable for Box<TLObject> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `all_type_ids` in implementation
   |
   = note: `all_type_ids` from trait: `fn() -> &'static [u32]`

...

error[E0277]: the trait bound `T: serde_mtproto::Identifiable` is not satisfied
  --> src/rpc/message.rs:44:39
   |
44 | #[derive(Debug, PartialEq, Serialize, Deserialize, MtProtoSized)]
   |                                       ^^^^^^^^^^^ the trait `serde_mtproto::Identifiable` is not implemented for `T`
   |
   = help: consider adding a `where T: serde_mtproto::Identifiable` bound
   = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::Boxed<T>`
   = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::WithSize<serde_mtproto::Boxed<T>>`
   = note: required by `serde::de::SeqAccess::next_element`

error[E0277]: the trait bound `T: serde_mtproto::MtProtoSized` is not satisfied
  --> src/rpc/message.rs:44:39
   |
44 | #[derive(Debug, PartialEq, Serialize, Deserialize, MtProtoSized)]
   |                                       ^^^^^^^^^^^ the trait `serde_mtproto::MtProtoSized` is not implemented for `T`
   |
   = help: consider adding a `where T: serde_mtproto::MtProtoSized` bound
   = note: required because of the requirements on the impl of `serde_mtproto::MtProtoSized` for `serde_mtproto::Boxed<T>`
   = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::WithSize<serde_mtproto::Boxed<T>>`
   = note: required by `serde::de::SeqAccess::next_element`

error[E0277]: the trait bound `T: serde_mtproto::Identifiable` is not satisfied
  --> src/rpc/message.rs:44:39
   |
44 | #[derive(Debug, PartialEq, Serialize, Deserialize, MtProtoSized)]
   |                                       ^^^^^^^^^^^ the trait `serde_mtproto::Identifiable` is not implemented for `T`
   |
   = help: consider adding a `where T: serde_mtproto::Identifiable` bound
   = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::Boxed<T>`
   = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::WithSize<serde_mtproto::Boxed<T>>`
   = note: required by `serde::de::MapAccess::next_value`

error[E0277]: the trait bound `T: serde_mtproto::MtProtoSized` is not satisfied
  --> src/rpc/message.rs:44:39
   |
44 | #[derive(Debug, PartialEq, Serialize, Deserialize, MtProtoSized)]
   |                                       ^^^^^^^^^^^ the trait `serde_mtproto::MtProtoSized` is not implemented for `T`
   |
   = help: consider adding a `where T: serde_mtproto::MtProtoSized` bound
   = note: required because of the requirements on the impl of `serde_mtproto::MtProtoSized` for `serde_mtproto::Boxed<T>`
   = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::WithSize<serde_mtproto::Boxed<T>>`
   = note: required by `serde::de::MapAccess::next_value`

error[E0308]: mismatched types
   --> src/rpc/message.rs:191:86
    |
191 |                     serde_mtproto::from_reader(decrypted_data_serialized.as_slice(), None)?;
    |                                                                                      ^^^^ expected reference, found enum `std::option::Option`
    |
    = note: expected type `&[&'static str]`
               found type `std::option::Option<_>`
    = help: here are some functions which might fulfill your needs:
            - .unwrap()
            - .unwrap_or_default()

error[E0277]: the trait bound `T: serde_mtproto::Identifiable` is not satisfied
   --> src/rpc/message.rs:267:71
    |
267 |                     let ref_body: EitherRef<WithSize<Boxed<T>>> = seq.next_element()?
    |                                                                       ^^^^^^^^^^^^ the trait `serde_mtproto::Identifiable` is not implemented for `T`
    |
    = help: consider adding a `where T: serde_mtproto::Identifiable` bound
    = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::Boxed<T>`
    = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::WithSize<serde_mtproto::Boxed<T>>`
    = note: required because of the requirements on the impl of `serde::Deserialize<'de>` for `rpc::utils::EitherRef<'_, serde_mtproto::WithSize<serde_mtproto::Boxed<T>>>`

error[E0277]: the trait bound `T: serde_mtproto::MtProtoSized` is not satisfied
   --> src/rpc/message.rs:267:71
    |
267 |                     let ref_body: EitherRef<WithSize<Boxed<T>>> = seq.next_element()?
    |                                                                       ^^^^^^^^^^^^ the trait `serde_mtproto::MtProtoSized` is not implemented for `T`
    |
    = help: consider adding a `where T: serde_mtproto::MtProtoSized` bound
    = note: required because of the requirements on the impl of `serde_mtproto::MtProtoSized` for `serde_mtproto::Boxed<T>`
    = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `serde_mtproto::WithSize<serde_mtproto::Boxed<T>>`
    = note: required because of the requirements on the impl of `serde::Deserialize<'de>` for `rpc::utils::EitherRef<'_, serde_mtproto::WithSize<serde_mtproto::Boxed<T>>>`

error[E0308]: mismatched types
   --> src/rpc/session.rs:218:65
    |
218 |         let mut deserializer = Deserializer::new(message_bytes, None);
    |                                                                 ^^^^ expected reference, found enum `std::option::Option`
    |
    = note: expected type `&[&'static str]`
               found type `std::option::Option<_>`
    = help: here are some functions which might fulfill your needs:
            - .unwrap()
            - .unwrap_or_default()

I was going to try poking at this a bit, but realized @hcpl might have already.

Hummer12007 commented 6 years ago

https://github.com/Hummer12007/mtproto-rs/commit/6c574884090a8b36851f37c39d596ff65b6641df

Connicpu commented 6 years ago

@Hummer12007 great ^^ Can you open a PR with those fixes?

Hummer12007 commented 6 years ago

@Connicpu I've opened it against @hcpl 's next branch. And I'm currently poking him to merge all the changes he's made (and these new changes) here.