Skip to content

Commit 44d2faf

Browse files
committed
fix(unicode-table-generator): fix duplicated unique indices
unicode-table-generator panicked while populating distinct_indices because of duplicated indices. This was introduced in rust-lang#144134, where the order of canonical_words.push(...) and canonical_words.len() was swapped. Fixes: rust-lang#144134
1 parent 0f35336 commit 44d2faf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/unicode-table-generator/src/raw_emitter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl Canonicalized {
341341
for &w in unique_words {
342342
unique_mapping.entry(w).or_insert_with(|| {
343343
canonical_words.push(w);
344-
UniqueMapping::Canonical(canonical_words.len())
344+
UniqueMapping::Canonical(canonical_words.len() - 1)
345345
});
346346
}
347347
assert_eq!(canonicalized_words.len() + canonical_words.len(), unique_words.len());

0 commit comments

Comments
 (0)