You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 15, 2025. It is now read-only.
use serde::{Deserialize, Serialize};
fn main() {
#[derive(Debug, Serialize, Deserialize)]
struct Struct {
a: u8,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(tag = "version")]
enum Test {
Variant(Struct),
}
let data = Test::Variant(Struct { a: 7 });
let serialized = bincode2::serialize(&data).unwrap();
let deserialized: Test = bincode2::deserialize(&serialized).unwrap();
}
The deserialize fails with DeserializeAnyNotSupportedwhen I have the #[serde(tag="version")] enabled like above. If i remove it, it does work. Serialize always works and seems to put additional info when tagging is enabled. Couldn't find any hints on how to solve this and this does not seem to be known issue (https://docs.rs/bincode/2.0.0-alpha.1/bincode/serde/index.html#known-issues).
The behavior is the same for bincode 2.0.1 and 1.3.3.
huntc, Sciguymjm, alexniver, yottacto, ErikbStorm and 1 more