Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bincode-org/bincode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.3
Choose a base ref
...
head repository: bincode-org/bincode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.0.0
Choose a head ref
Loading
Showing with 13,441 additions and 4,401 deletions.
  1. +14 −0 .github/FUNDING.yml
  2. +13 −0 .github/dependabot.yml
  3. +18 −0 .github/stale.yml
  4. +40 −0 .github/workflows/cifuzz.yml
  5. +248 −0 .github/workflows/cross_platform.yml
  6. +40 −0 .github/workflows/miri.yml
  7. +195 −175 .github/workflows/rust.yml
  8. +1 −1 .github/workflows/security.yml
  9. +2 −0 .gitignore
  10. +1 −0 .rustfmt.toml
  11. +128 −0 CODE_OF_CONDUCT.md
  12. +58 −19 Cargo.toml
  13. +17 −0 benches/inline.rs
  14. +73 −0 benches/string.rs
  15. +152 −0 benches/varint.rs
  16. +12 −0 compatibility/Cargo.toml
  17. +49 −0 compatibility/README.md
  18. +123 −0 compatibility/src/lib.rs
  19. +52 −0 compatibility/src/membership.rs
  20. +94 −0 compatibility/src/misc.rs
  21. +25 −0 compatibility/src/rand.rs
  22. +85 −0 compatibility/src/sway.rs
  23. +2 −0 derive/.gitignore
  24. +23 −0 derive/Cargo.toml
  25. +1 −0 derive/LICENSE.md
  26. +28 −0 derive/readme.md
  27. +131 −0 derive/src/attribute.rs
  28. +449 −0 derive/src/derive_enum.rs
  29. +211 −0 derive/src/derive_struct.rs
  30. +105 −0 derive/src/lib.rs
  31. +116 −0 docs/migration_guide.md
  32. +335 −0 docs/spec.md
  33. +0 −27 examples/basic.rs
  34. +3 −0 fuzz/.gitignore
  35. +134 −0 fuzz/Cargo.lock
  36. +33 −0 fuzz/Cargo.toml
  37. +77 −0 fuzz/fuzz_targets/compat.rs
  38. +52 −0 fuzz/fuzz_targets/roundtrip.rs
  39. BIN logo.png
  40. +15 −0 logo.svg
  41. +41 −42 readme.md
  42. +226 −0 src/atomic.rs
  43. +294 −0 src/config.rs
  44. +0 −29 src/config/endian.rs
  45. +0 −682 src/config/int.rs
  46. +0 −253 src/config/legacy.rs
  47. +0 −49 src/config/limit.rs
  48. +0 −408 src/config/mod.rs
  49. +0 −37 src/config/trailing.rs
  50. +142 −0 src/de/decoder.rs
  51. +186 −0 src/de/impl_core.rs
  52. +54 −0 src/de/impl_tuples.rs
  53. +798 −0 src/de/impls.rs
  54. +277 −458 src/de/mod.rs
  55. +83 −173 src/de/read.rs
  56. +57 −0 src/enc/encoder.rs
  57. +404 −0 src/enc/impl_tuples.rs
  58. +491 −0 src/enc/impls.rs
  59. +103 −0 src/enc/mod.rs
  60. +82 −0 src/enc/write.rs
  61. +244 −94 src/error.rs
  62. +2 −0 src/features/derive.rs
  63. +603 −0 src/features/impl_alloc.rs
  64. +554 −0 src/features/impl_std.rs
  65. +18 −0 src/features/mod.rs
  66. +496 −0 src/features/serde/de_borrowed.rs
  67. +523 −0 src/features/serde/de_owned.rs
  68. +303 −0 src/features/serde/mod.rs
  69. +406 −0 src/features/serde/ser.rs
  70. +0 −124 src/internal.rs
  71. +194 −158 src/lib.rs
  72. +0 −772 src/ser/mod.rs
  73. +3 −0 src/utils.rs
  74. +92 −0 src/varint/decode_signed.rs
  75. +710 −0 src/varint/decode_unsigned.rs
  76. +318 −0 src/varint/encode_signed.rs
  77. +383 −0 src/varint/encode_unsigned.rs
  78. +29 −0 src/varint/mod.rs
  79. +197 −0 tests/alloc.rs
  80. +66 −0 tests/atomic.rs
  81. +310 −0 tests/basic_types.rs
  82. +105 −0 tests/context.rs
  83. +446 −0 tests/derive.rs
  84. +14 −0 tests/derive_rename.rs
  85. +15 −0 tests/error_size.rs
  86. +40 −0 tests/issues.rs
  87. +69 −0 tests/issues/issue_427.rs
  88. +42 −0 tests/issues/issue_431.rs
  89. +13 −0 tests/issues/issue_459.rs
  90. +14 −0 tests/issues/issue_467.rs
  91. +94 −0 tests/issues/issue_474.rs
  92. +17 −0 tests/issues/issue_498.rs
  93. +37 −0 tests/issues/issue_500.rs
  94. +9 −0 tests/issues/issue_523.rs
  95. +8 −0 tests/issues/issue_537.rs
  96. +24 −0 tests/issues/issue_547.rs
  97. +6 −0 tests/issues/issue_570.rs
  98. +8 −0 tests/issues/issue_592.rs
  99. +22 −0 tests/issues/issue_614.rs
  100. +253 −0 tests/serde.rs
  101. +203 −0 tests/std.rs
  102. +0 −900 tests/test.rs
  103. +158 −0 tests/utils.rs
14 changes: 14 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: bincode
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: cargo
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
18 changes: 18 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- security
- not-stale
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
40 changes: 40 additions & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "CIFuzz",
"on": [
"pull_request"
],
"jobs": {
"Fuzzing": {
"runs-on": "ubuntu-latest",
"steps": [
{
"name": "Build Fuzzers",
"id": "build",
"uses": "google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master",
"with": {
"oss-fuzz-project-name": "bincode",
"language": "rust"
}
},
{
"name": "Run Fuzzers",
"uses": "google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master",
"with": {
"oss-fuzz-project-name": "bincode",
"fuzz-seconds": 300,
"language": "rust"
}
},
{
"name": "Upload Crash",
"uses": "actions/upload-artifact@v4",
"if": "failure() && steps.build.outcome == 'success'",
"with": {
"name": "artifacts",
"path": "./out/artifacts"
}
}
]
}
}
}
248 changes: 248 additions & 0 deletions .github/workflows/cross_platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
{
"name": "Cross platform tests",
"on": {
"push": {
"branches": [
"trunk",
"v*.x",
"ci/*"
]
},
"pull_request": {
"branches": [
"trunk",
"v*.x"
]
}
},
"jobs": {
"test_cross_std": {
"name": "Cross platform test (platforms with standard library)",
"runs-on": "ubuntu-latest",
"strategy": {
"fail-fast": false,
"matrix": {
"platform": [
# Tier 1
"aarch64-unknown-linux-gnu",
# 0050:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
# 0050:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
# 0050:err:systray:initialize_systray Could not create tray window
# 0024:err:module:import_dll Library bcryptprimitives.dll (which is needed by L"Z:\\target\\i686-pc-windows-gnu\\debug\\deps\\bincode-569310bd32491256.exe") not found
# 0024:err:module:LdrInitializeThunk Importing dlls for L"Z:\\target\\i686-pc-windows-gnu\\debug\\deps\\bincode-569310bd32491256.exe" failed, status c0000135
# "i686-pc-windows-gnu",

# `cross` does not provide a Docker image for target i686-pc-windows-msvc
# "i686-pc-windows-msvc",
"i686-unknown-linux-gnu",
# `cross` does not provide a Docker image for target x86_64-apple-darwin
# "x86_64-apple-darwin",

# 0050:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
# 0050:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
# 0050:err:systray:initialize_systray Could not create tray window
# 00f4:err:module:import_dll Library bcryptprimitives.dll (which is needed by L"Z:\\target\\x86_64-pc-windows-gnu\\debug\\deps\\bincode-b91af23bf3efc9f3.exe") not found
# 00f4:err:module:LdrInitializeThunk Importing dlls for L"Z:\\target\\x86_64-pc-windows-gnu\\debug\\deps\\bincode-b91af23bf3efc9f3.exe" failed, status c0000135
# "x86_64-pc-windows-gnu",

# `cross` does not provide a Docker image for target x86_64-pc-windows-msvc
# "x86_64-pc-windows-msvc",
"x86_64-unknown-linux-gnu",

# Tier 2
# `cross` does not provide a Docker image for target aarch64-apple-darwin
# "aarch64-apple-darwin",
# `cross` does not provide a Docker image for target aarch64-pc-windows-msvc
# "aarch64-pc-windows-msvc",
"aarch64-unknown-linux-musl",
"arm-unknown-linux-gnueabi",
"arm-unknown-linux-gnueabihf",
"armv7-unknown-linux-gnueabihf",
# `cross` does not provide a Docker image for target loongarch64-unknown-linux-gnu
# "loongarch64-unknown-linux-gnu",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "mips-unknown-linux-gnu",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "mips64-unknown-linux-gnuabi64",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "mips64el-unknown-linux-gnuabi64",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "mipsel-unknown-linux-gnu",
"powerpc-unknown-linux-gnu",
"powerpc64-unknown-linux-gnu",
"powerpc64le-unknown-linux-gnu",
"riscv64gc-unknown-linux-gnu",
"s390x-unknown-linux-gnu",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "x86_64-unknown-freebsd",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "x86_64-unknown-illumos",
"x86_64-unknown-linux-musl",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "x86_64-unknown-netbsd",

# Tier 3, only those that have std
# `cross` does not provide a Docker image for target aarch64-apple-ios
# "aarch64-apple-ios",
# `cross` does not provide a Docker image for target aarch64-apple-ios-sim
# "aarch64-apple-ios-sim",
# `cross` does not provide a Docker image for target aarch64-fuchsia
# "aarch64-fuchsia",
# `cross` does not provide a Docker image for target aarch64-unknown-fuchsia
# "aarch64-unknown-fuchsia",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/1222): currently broken
# "aarch64-linux-android",
"arm-linux-androideabi",
"arm-unknown-linux-musleabi",
"arm-unknown-linux-musleabihf",
"armv5te-unknown-linux-gnueabi",
"armv5te-unknown-linux-musleabi",
"armv7-linux-androideabi",
"armv7-unknown-linux-gnueabi",
"armv7-unknown-linux-musleabi",
"armv7-unknown-linux-musleabihf",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/634): broken
# "asmjs-unknown-emscripten",
"i586-unknown-linux-gnu",
"i586-unknown-linux-musl",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/1222): currently broken
# "i686-linux-android",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "i686-unknown-freebsd",
"i686-unknown-linux-musl",
# "mips-unknown-linux-musl",
# "mips64-unknown-linux-muslabi64",
# "mips64el-unknown-linux-muslabi64",
# "mipsel-unknown-linux-musl",
# Could not link to `getrandom`
# "sparc64-unknown-linux-gnu",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "sparcv9-sun-solaris",
"thumbv7neon-linux-androideabi",
"thumbv7neon-unknown-linux-gnueabihf",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "wasm32-unknown-emscripten",
# `cross` does not provide a Docker image for target wasm32-unknown-unknown
# "wasm32-unknown-unknown",
# `cross` does not provide a Docker image for target wasm32-wasi
# "wasm32-wasi",
# `cross` does not provide a Docker image for target x86_64-apple-ios
# "x86_64-apple-ios",
# `cross` does not provide a Docker image for target x86_64-fortanix-unknown-sgx
# "x86_64-fortanix-unknown-sgx",
# `cross` does not provide a Docker image for target x86_64-fuchsia
# "x86_64-fuchsia",
# `cross` does not provide a Docker image for target x86_64-unknown-fuchsia
# "x86_64-unknown-fuchsia",
# BLOCKEDTODO(https://github.com/cross-rs/cross/issues/975): currently broken
# "x86_64-linux-android",
# `cross` does not provide a Docker image for target x86_64-pc-solaris
# "x86_64-pc-solaris",
# `cross` does not provide a Docker image for target x86_64-unknown-linux-gnux32
# "x86_64-unknown-linux-gnux32",
# `cross` does not provide a Docker image for target x86_64-unknown-redox
# "x86_64-unknown-redox",
]
}
},
"steps": [
{
"uses": "actions/checkout@v4",
"name": "Checkout"
},
{
"uses": "actions-rs/toolchain@v1",
"with": {
"profile": "minimal",
"toolchain": "stable",
"override": true
},
"name": "Install Rust stable"
},
{
"uses": "actions-rs/install@v0.1",
"with": {
"crate": "cross"
},
"name": "Install cargo cross"
},
{
"run": "cross test --target ${{ matrix.platform }}",
"name": "Run tests",
"env": {
"RUSTFLAGS": "-D warnings",
"RUST_BACKTRACE": "1",
}
}
]
},
# None of these work, needs more investigation
# "test_cross_no_std": {
# "name": "Cross platform test (no_std, platforms without standard library)",
# "runs-on": "ubuntu-latest",
# "strategy": {
# "fail-fast": false,
# "matrix": {
# "platform": [
# # Tier 3
# "aarch64-unknown-none-softfloat",
# "aarch64-unknown-none",
# "aarch64-unknown-uefi",
# "armebv7r-none-eabi",
# "armebv7r-none-eabihf",
# "armv7a-none-eabi",
# "armv7r-none-eabi",
# "armv7r-none-eabihf",
# "i586-pc-windows-msvc",
# "i686-unknown-uefi",
# "nvptx64-nvidia-cuda",
# "riscv32i-unknown-none-elf",
# "riscv32imac-unknown-none-elf",
# "riscv32imc-unknown-none-elf",
# "riscv64gc-unknown-none-elf",
# "riscv64imac-unknown-none-elf",
# "thumbv6m-none-eabi",
# "thumbv7em-none-eabi",
# "thumbv7em-none-eabihf",
# "thumbv7m-none-eabi",
# "thumbv8m.base-none-eabi",
# "thumbv8m.main-none-eabi",
# "thumbv8m.main-none-eabihf",
# "x86_64-unknown-none",
# "x86_64-unknown-uefi",
# ]
# }
# },
# "steps": [
# {
# "uses": "actions/checkout@v4",
# "name": "Checkout"
# },
# {
# "uses": "actions-rs/toolchain@v1",
# "with": {
# "profile": "minimal",
# "toolchain": "stable",
# "override": true
# },
# "name": "Install Rust stable"
# },
# {
# "uses": "actions-rs/install@v0.1",
# "with": {
# "crate": "cross"
# },
# "name": "Install cargo cross"
# },
# {
# "run": "cross test --target ${{ matrix.platform }} --no-default-features --features alloc,derive",
# "name": "Run tests",
# "env": {
# "RUSTFLAGS": "-D warnings",
# "RUST_BACKTRACE": "1",
# }
# }
# ]
# }
}
}
40 changes: 40 additions & 0 deletions .github/workflows/miri.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "miri",
"on": {
"push": {
"branches": [
"trunk",
"v*.x",
"ci/*"
]
},
"pull_request": {
"branches": [
"trunk",
"v*.x"
]
}
},
"jobs": {
"miri": {
"name": "MIRI",
"runs-on": "ubuntu-latest",
"steps": [
{
"uses": "actions/checkout@v2",
"name": "Checkout"
},
{
"run": "rustup toolchain install nightly --component miri \n
rustup override set nightly \n
cargo miri setup",
"name": "Install Rust nightly"
},
{
"run": "cargo miri test",
"name": "Default features"
}
]
}
}
}
Loading