Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion crates/guest-rust/macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,14 @@ impl Parse for Config {
Opt::AdditionalMemberAttributes(list) => {
opts.additional_member_attributes = list
}
Opt::With(with) => opts.with.extend(with),
Opt::With(with) => {
// `HashMap` iteration order is non-deterministic, which can cause
// non-determinism in crates that invoke the macro. Sort by key so the
// output is stable.
let mut with: Vec<_> = with.into_iter().collect();
with.sort_by(|a, b| a.0.cmp(&b.0));
opts.with.extend(with)
}
Opt::GenerateAll => {
opts.generate_all = true;
}
Expand Down
Loading