rust/compiler/rustc_errors/src
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
..
json Reformat use declarations. 2024-07-29 08:26:52 +10:00
markdown Reformat use declarations. 2024-07-29 08:26:52 +10:00
annotate_snippet_emitter_writer.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
codes.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
diagnostic.rs Maintain highlighting in note and help even when they have a span 2024-08-06 17:54:37 +00:00
diagnostic_impls.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
emitter.rs Auto merge of #128465 - GrigorenkoPV:128200, r=estebank 2024-08-08 09:59:09 +00:00
error.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
json.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lib.rs Do not underline suggestions for code that is already there 2024-08-01 18:53:42 +00:00
lock.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
registry.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
snippet.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
styled_buffer.rs Replace some _ == _ || _ == _s with matches!(_, _ | _)s 2023-01-30 12:26:26 +00:00
tests.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
translation.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00