fix: close remaining 0.1.0 release gaps - #15
Merged
Merged
Conversation
Why: removing every space from syn-rendered paths corrupts valid qualified paths such as <T as Trait>::function into a different token sequence. Normalize punctuation spacing while retaining the keyword separators downstream tools need to display and compare the original Serde metadata. Signed-off-by: tison <[email protected]>
Why: the built-in [T; 0] shape intentionally works without T implementing a shape trait because no element is observed, but derive inference reintroduced that bound for generic container fields. Skip only syntactically zero array lengths so derived wrappers preserve the same valid contract without weakening bounds for populated arrays. Signed-off-by: tison <[email protected]>
Why: the README is embedded in both publishable crates and the same snippets appear in rustdoc. Leaving them on 0.0.1 would make the 0.1.0 release immediately direct new users to the superseded API. Signed-off-by: tison <[email protected]>
Why: proc_macro2 owns the round-trip contract for token-stream display, while the handwritten whitespace normalizer depended on incidental formatting and could miss valid Rust syntax. Keep the renderer's output intact, document its whitespace semantics, and test paths by reparsing them instead of comparing cosmetic formatting. Signed-off-by: tison <[email protected]>
Why: the selective AST walk resembles a local parser but intentionally follows Serde's own bound inference. Recording that source and the const-expression boundary prevents a future generic visitor refactor from introducing spurious Shape bounds. Signed-off-by: tison <[email protected]>
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
This is a narrow 0.1.0 release audit, limited to issues with a reproducible downstream failure or an unambiguous release-facing mismatch.
<T as Trait>::functionas parseable Rust token streams, relying onproc_macro2's round-trip contract instead of maintaining a whitespace formatter[T; 0]shape contractReview order
The commits are intentionally small. The fourth commit is an additive correction to the first one after review; history was not rewritten. Each commit message contains a
Why:paragraph describing the concrete user failure or maintenance risk.fix: preserve qualified Serde pathsfix: avoid empty-array element bounds in derivesdocs: target installation examples at 0.1.0fix: preserve parseable path metadatadocs: identify the derive-bound referenceDeliberate non-changes
The broader "not invented here" audit did not find another production implementation that could be replaced without increasing risk:
serde_derive::bound::with_bounduses the same selective approach; a generalsyn::visit::Visitwould enter macro and const-expression syntax and can infer spurious shape boundscargo packageconflicts with--lockedat the workspace-resolution stagecargo metadataJSON lookup remains local; addingcargo_metadatawould add more dependency and API surface than it removesThe audit also found no evidence for deleting existing behavior-boundary tests, changing the public graph model, adding format policy, or expanding built-in coverage speculatively.
Validation
cargo x build --lockedcargo x testcargo x lintcargo x package --lockedcargo +1.85.0 x testcargo +1.85.0 check -p serde-shape --lib --no-default-features --target thumbv7em-none-eabihfcargo +1.85.0 check -p serde-shape-test-no-std --lib --target thumbv7em-none-eabihfcargo semver-checks check-release -p serde-shape --baseline-rev origin/main --release-type patch --all-features(223 checks passed)