Skip to content

Commit

Permalink
serde::Serialize -> serde_derive::Serialize
Browse files Browse the repository at this point in the history
serde:: doesn't work on tests on CI
  • Loading branch information
arturoc committed Apr 19, 2022
1 parent 8a5eb88 commit 44c7063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -1812,7 +1812,7 @@ mod tests {
}

bitflags! {
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
struct SerdeFlags: u32 {
const A = 1;
const B = 2;
Expand Down

1 comment on commit 44c7063

@decathorpe
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, It seems you were bitten by a change in trybuild and peculiarities of how Cargo resolves and unifies features and dependencies:
dtolnay/trybuild@7c04ae7

You don't have the serde/derive feature enabled in Cargo.toml but have implicitly relied on it, which only worked because Cargo pulled it in anyway because trybuild depended on it.
But as soon as trybuild stopped using the serde/derive feature, the dependency could no longer be resolved.

If you want to use serde::{Serialize,Deserialize} correctly, you'd need to explicitly enable the derive feature of the serde dev-dependency explicitly (or switch to using serde_derive directly, as you have done here).

Please sign in to comment.