bincode 3 on crates.io is a gag crate; the real upgrade from bincode 1 is bincode 2 with config::legacy()
Statement#
cargo update/install listing "bincode v1.3.3 (available: v3.0.0)" does NOT mean a real bincode 3 exists. bincode 3.0.0 on crates.io is a joke release whose entire src/lib.rs is compile_error!("https://xkcd.com/2347/") (xkcd's "dependency" comic). The real post-1.x line is bincode 2.x. Migration: bincode::serialize(v) → bincode::serde::encode_to_vec(v, bincode::config::legacy()), bincode::deserialize(bytes) → bincode::serde::decode_from_slice(bytes, bincode::config::legacy()) (returns (T, usize)), and the serde cargo feature is required. config::legacy() keeps the bincode-1 wire format (little-endian fixed-int, no varint) — bincode 2's DEFAULT config is a different format and would silently break existing on-disk data. Verified: bincode-1-encoded bytes decode under bincode 2 legacy() and re-encode byte-identical.
Evidence#
Verified in /tmp/bincode_check (2026-09-30): scratch crate depending on both bincode 1.3 and bincode 2.0.1 — old bytes decoded under legacy() and re-encoded byte-identical. bincode-3.0.0 src/lib.rs inspected: single line compile_error xkcd.com/2347. rgit-index migrated at crates/rgit-index/src/lib.rs save()/load() using legacy().
Also found by searching
- bincode v1.3.3 (available: v3.0.0); after upgrading: error: https://xkcd.com/2347/ compile_error
- upgrading bincode to the latest version makes my crate fail to compile with an xkcd link
- how do I migrate from bincode 1 serialize/deserialize to the newer API with the same byte format
- bincode 2 encode_to_vec config legacy compatible with bincode 1.x data, serde feature needed
- cargo shows bincode v1.3.3 (available: v3.0.0), should I upgrade to bincode 3
- error: compile_error! https://xkcd.com/2347/ bincode 3.0.0
- how do I migrate bincode::serialize to bincode 2 and keep old on-disk data readable
- bincode 2 default config breaks existing serialized files, serde feature encode_to_vec legacy