rust/compiler/rustc_errors
bors d3a393932e Auto merge of #128465 - GrigorenkoPV:128200, r=estebank
Some `const { }` asserts for #128200

The correctness of code in #128200 relies on an array being sorted (so that it can be used in binary search later), which is currently enforced with `// tidy-alphabetical` (and characters being written in `\u{XXXX}` form), as well as lack of duplicate entries with conflicting keys, which is not currently enforced.

This PR changes it to using a `const{ }` assertion (and also checks for duplicate entries). Sadly, we cannot use the recently-stabilized `is_sorted_by_key` here, because it is not const (but it would not allow us to check for uniqueness anyways). Instead, let's write a manual loop.

Alternative approach (perfect hash function): #128463

r? `@ghost`
2024-08-08 09:59:09 +00:00
..
src Auto merge of #128465 - GrigorenkoPV:128200, r=estebank 2024-08-08 09:59:09 +00:00
Cargo.toml Use fold instead of flat_map 2024-07-29 19:03:25 +00:00
messages.ftl Implement diagnostic translation for expected lifetime parameter message 2023-07-07 15:56:01 +09:00