diff options
| author | bors <bors@rust-lang.org> | 2024-08-08 09:59:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-08 09:59:09 +0000 |
| commit | d3a393932eeafa4638ae22f5ecbc38bf38760d0e (patch) | |
| tree | 53dfce2310acc7557a9b2508cc4f7cfa438348ec /compiler/rustc_parse/src | |
| parent | 9337f7afa6fda07e60d6aa5ee88e692878446782 (diff) | |
| parent | 15982b2fcae0fba61816dbd31617bc6604e36af5 (diff) | |
| download | rust-d3a393932eeafa4638ae22f5ecbc38bf38760d0e.tar.gz rust-d3a393932eeafa4638ae22f5ecbc38bf38760d0e.zip | |
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`
Diffstat (limited to 'compiler/rustc_parse/src')
0 files changed, 0 insertions, 0 deletions
