Skip to content

Support preserve_order in no_std builds - #1333

Open
razmser wants to merge 1 commit into
serde-rs:masterfrom
razmser:no-std-preserve-order
Open

Support preserve_order in no_std builds#1333
razmser wants to merge 1 commit into
serde-rs:masterfrom
razmser:no-std-preserve-order

Conversation

@razmser

@razmser razmser commented Jul 22, 2026

Copy link
Copy Markdown

preserve_order currently implies std (since #885), so it cannot be enabled in no_std + alloc builds.
Make it imply alloc instead, using RandomState with std and rustc_hash::FxBuildHasher without it.

Compatibility: default-features = false, features = ["preserve_order"] now produces an alloc-only build rather than implicitly enabling std.

Security: the deterministic FxHasher used by no_std builds is not HashDoS-resistant. Existing std builds are unaffected.

@razmser
razmser force-pushed the no-std-preserve-order branch from 958abbf to 5faf8b4 Compare July 22, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant