Repository navigation
Modernize to edition 2024, latest dependencies, workspace-inherited deps - #116
Merged
Merged
Conversation
Move all crates to edition 2024 (MSRV 1.85, resolver 3), bump every
dependency to its latest major/minor release (syn 3.0.6, bitvec 1.1.1,
serde 1.0.229, quote 1.0.47, proc-macro2 1.0.107) and centralize
dependencies and shared package metadata in [workspace.dependencies] /
[workspace.package]. Bump packed_struct and packed_struct_codegen to 0.12.0.
Fixes surfaced by the upgrade:
- PackedStruct derive generated `{ &<temp> }.pack()`, which fails to
borrow-check in edition 2024 crates due to tail-expression temporary
scope changes; use `(&<temp>).pack()` instead.
- Remove the nightly-only `#![feature(alloc)]` that made the `alloc`
feature unbuildable on stable, and add the missing Formatter import
to the no_std prelude.
- Replace serde_derive with serde's `derive` feature; `std` no longer
implicitly enables serde (`serde?/std`).
- Use bitvec 1.1's shift_start/shift_end instead of deprecated names.
- Fix clippy lints that already failed CI on current stable; the
workspace now builds with zero warnings.
packed_struct_nostd_tests stays excluded from the workspace: a
workspace-wide build would unify packed_struct_codegen's `std` feature
and emit std paths into the no_std crate.
CI: checkout@v5, explicit toolchains, feature-combination checks and
an MSRV (1.85) job.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mips64-unknown-linux-gnuabi64 was demoted to tier 3 in Rust 1.72 and no longer ships a prebuilt std, so `cross build` fails with "can't find crate for `core`". s390x-unknown-linux-gnu keeps big-endian coverage on a tier 2 target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rust-version = "1.85",resolver = "3".[workspace.dependencies]/[workspace.package]; members useworkspace = true.packed_structandpacked_struct_codegenbumped to 0.12.0 because of the MSRV raise.Fixes the upgrade turned up
#[derive(PackedStruct)]generated{ &<temp> }.pack()?. Edition 2024 drops tail-expression temporaries at the end of the block, so user crates on 2024 failed with E0716. It now emits(&<temp>).pack()?, which is correct in every edition (packed_struct_codegen/src/pack_codegen.rs).allocfeature never built on stable. Removed the nightly-only#![cfg_attr(feature="alloc", feature(alloc))]and added the missingFormatterimport to the no_std prelude. Dropped "Requires nightly Rust" from the docs.serde_derivewithserde'sderivefeature (use_serde = ["dep:serde", "serde/derive"]).stdusedserde/std, which silently turned serde on; it's nowserde?/std. The implicitserde/serde_derivefeatures are gone;use_serdeis unchanged.shift_left/shift_right→shift_start/shift_end.packed_struct_codegen, then more inpacked_structand the tests). Fixed mechanically:iN::MINinstead ofmin_value(), two dead fields removed, empty glob re-exports removed,#![allow(unused_imports)]on the internal prelude, and acheck-cfgentry for a cfg thaterror_chain!expands to. The workspace now builds with zero warnings.extern crate/#[macro_use]lines;core::intrinsics::write_bytes→core::ptr::write_bytes.Reviewer notes
packed_struct_nostd_testsstays excluded from the workspace. The codegen emits::stdor::corepaths depending on its ownstdfeature. A workspace-wide build unifies that feature, enabled bypacked_struct_tests, and breaks the no_std crate. There's a comment explaining this in the rootCargo.toml.allocuser crate still has to declare#[macro_use] extern crate alloc;, because the generated code relies on it. That's unchanged by this PR.actions/checkout@v5, explicitdtolnay/rust-toolchain, feature-combination checks (--no-default-features,+alloc,--all-features), and a new MSRV 1.85 job.mips64-unknown-linux-gnuabi64withs390x-unknown-linux-gnu. mips64 has been tier 3 since Rust 1.72 and has no prebuilt std, socross buildfailed with "can't find crate forcore". s390x keeps a big-endian target in the matrix on tier 2.Testing
cargo test --workspace: 117 passed, 0 failed (same as before), including doctests.cd packed_struct_nostd_tests && cargo test: passes.cargo clippy -p packed_struct_tests --all-targets -- -D warnings: clean.cargo check -p packed_structwith--no-default-features,--no-default-features --features alloc,--no-default-features --features use_serde,--features use_serde,byte_types_256and--all-features: all pass without warnings.cargo +1.89 check --workspace --all-targets: passes. 1.85 was not installed locally, so the new CI job covers it.cargo package -p packed_struct_codegen: the packaged manifest resolves the inherited fields correctly.🤖 Generated with Claude Code