SpaceManiac / discord-rs

Rust library for the Discord chat client API
MIT License
390 stars 94 forks source link

Can not compile discord rs with chrono 0.4 #123

Closed iddm closed 7 years ago

iddm commented 7 years ago

After recent update of chrono crate I can't compile the discord crate anymore:

   Compiling discord v0.8.0 (https://github.com/SpaceManiac/discord-rs#e401c10b)
error[E0277]: the trait bound `chrono::DateTime<chrono::FixedOffset>: serde::Serialize` is not satisfied
   --> /home/user/.cargo/git/checkouts/discord-rs-e20ed8881d23c413/e401c10/src/model.rs:389:24
    |
389 | #[derive(Debug, Clone, Serialize, Deserialize)]
    |                        ^^^^^^^^^ the trait `serde::Serialize` is not implemented for `chrono::DateTime<chrono::FixedOffset>`
    |
    = note: required because of the requirements on the impl of `serde::Serialize` for `std::option::Option<chrono::DateTime<chrono::FixedOffset>>`
    = note: required by `serde::ser::SerializeStruct::serialize_field`

error[E0277]: the trait bound `chrono::DateTime<chrono::FixedOffset>: serde::Deserialize<'_>` is not satisfied
   --> /home/user/.cargo/git/checkouts/discord-rs-e20ed8881d23c413/e401c10/src/model.rs:389:35
    |
389 | #[derive(Debug, Clone, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^ the trait `serde::Deserialize<'_>` is not implemented for `chrono::DateTime<chrono::FixedOffset>`
    |
    = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `std::option::Option<chrono::DateTime<chrono::FixedOffset>>`
    = note: required by `serde::de::SeqAccess::next_element`

error[E0277]: the trait bound `chrono::DateTime<chrono::FixedOffset>: serde::Deserialize<'_>` is not satisfied
   --> /home/user/.cargo/git/checkouts/discord-rs-e20ed8881d23c413/e401c10/src/model.rs:389:35
    |
389 | #[derive(Debug, Clone, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^ the trait `serde::Deserialize<'_>` is not implemented for `chrono::DateTime<chrono::FixedOffset>`
    |
    = note: required because of the requirements on the impl of `serde::Deserialize<'_>` for `std::option::Option<chrono::DateTime<chrono::FixedOffset>>`
    = note: required by `serde::de::MapAccess::next_value`

error[E0277]: the trait bound `chrono::DateTime<chrono::FixedOffset>: serde::Serialize` is not satisfied
   --> /home/user/.cargo/git/checkouts/discord-rs-e20ed8881d23c413/e401c10/src/model.rs:647:24
    |
647 | #[derive(Debug, Clone, Serialize, Deserialize)]
    |                        ^^^^^^^^^ the trait `serde::Serialize` is not implemented for `chrono::DateTime<chrono::FixedOffset>`
    |
    = note: required by `serde::ser::SerializeStruct::serialize_field`

error[E0277]: the trait bound `chrono::DateTime<chrono::FixedOffset>: serde::Deserialize<'_>` is not satisfied
   --> /home/user/.cargo/git/checkouts/discord-rs-e20ed8881d23c413/e401c10/src/model.rs:647:35
    |
647 | #[derive(Debug, Clone, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^ the trait `serde::Deserialize<'_>` is not implemented for `chrono::DateTime<chrono::FixedOffset>`
    |
    = note: required by `serde::de::SeqAccess::next_element`

error[E0277]: the trait bound `chrono::DateTime<chrono::FixedOffset>: serde::Deserialize<'_>` is not satisfied
   --> /home/user/.cargo/git/checkouts/discord-rs-e20ed8881d23c413/e401c10/src/model.rs:647:35
    |
647 | #[derive(Debug, Clone, Serialize, Deserialize)]
    |                                   ^^^^^^^^^^^ the trait `serde::Deserialize<'_>` is not implemented for `chrono::DateTime<chrono::FixedOffset>`
    |
    = note: required by `serde::de::MapAccess::next_value`

error: aborting due to 6 previous errors

error: Could not compile `discord`.
SpaceManiac commented 7 years ago

Upstream chrono broke back-compat in v0.3.1, which has since been yanked. Delete and regenerate Cargo.lock to downgrade back to v0.3.0.

iddm commented 7 years ago

@SpaceManiac Deleted Cargo.lock, performed cargo clean, cargo update, cargo test and still have the same errors. Also, I don't have chrono 0.3.1 in my Cargo.lock but only 0.3 and 0.4.

I have just cloned your repo, performed the steps above again and have the same result.

iddm commented 7 years ago

After updating chrono everything works okay.

SpaceManiac commented 7 years ago

Looks like it was the reverse problem: we were depending on 0.3.1, and now that it's yanked, builds fail.

Xaeroxe commented 7 years ago

For future reference, the above compiler error looks like it was trying to compile chrono without the "serde" feature.

iddm commented 7 years ago

@Xaeroxe yes, but I checked it many times - everything was set up correctly, so it must be something else.