Skip to content

Commit 1e91337

Browse files
authored
Merge pull request #25 from bobrik/ivan/deterministic
Make conflict order deterministic
2 parents 16cbc65 + eff2afa commit 1e91337

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Fixed
9+
- fix nondeterminism in order of conflicting fields
810

911
## [0.10.3] - 2024-11-17
1012
### Fixed

macro/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,12 @@ impl Conflicts {
460460
}
461461

462462
fn to_tokens(&self, struct_error: &StructError) -> Result<TokenStream> {
463-
self.0
463+
let mut conflicts = self.0.iter().collect::<Vec<_>>();
464+
465+
// The order must be deterministic to be friendly to tools like sccache
466+
conflicts.sort();
467+
468+
conflicts
464469
.iter()
465470
.map(|(a, b)| {
466471
let af = Formattable::display(&a);

0 commit comments

Comments
 (0)