rust/compiler
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
..
rustc The rustc crate feature is called jemalloc 2024-07-15 13:01:20 -04:00
rustc_abi interpret: simplify pointer arithmetic logic 2024-08-01 14:25:19 +02:00
rustc_arena Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_ast Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_ast_ir Use dep: for crate dependencies 2024-07-15 12:40:10 -04:00
rustc_ast_lowering minor effects cleanups 2024-07-31 03:29:10 +00:00
rustc_ast_passes Rollup merge of #127921 - spastorino:stabilize-unsafe-extern-blocks, r=compiler-errors 2024-08-03 20:51:51 +02:00
rustc_ast_pretty Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_attr Rollup merge of #128341 - Alexendoo:parse-version-pub, r=compiler-errors 2024-07-29 17:46:44 +02:00
rustc_baked_icu_data Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_borrowck Don't arbitrarily choose one upper bound for hidden captured region 2024-08-06 15:43:41 -04:00
rustc_builtin_macros Make Span optional in BufferedEarlyLint 2024-08-07 14:08:34 +02:00
rustc_codegen_cranelift Move computation of decorated names out of the create_dll_import_lib method 2024-07-30 10:32:32 +00:00
rustc_codegen_gcc Rollup merge of #128221 - calebzulawski:implied-target-features, r=Amanieu 2024-08-07 20:28:16 +02:00
rustc_codegen_llvm Rollup merge of #128679 - RalfJung:codegen-fn-attrs, r=nikic 2024-08-07 20:28:18 +02:00
rustc_codegen_ssa Rollup merge of #128772 - glaubitz:sparc-elf-fix, r=nagisa 2024-08-07 20:28:19 +02:00
rustc_const_eval Disallow enabling features without their implied features 2024-08-07 00:45:00 -04:00
rustc_data_structures Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
rustc_driver Use tidy to sort crate attributes for all compiler crates. 2024-06-12 15:49:10 +10:00
rustc_driver_impl Add -Zerror-metrics=PATH to save diagnostic metadata to disk 2024-08-07 11:16:55 -07:00
rustc_error_codes Stabilize offset_of_nested 2024-07-29 17:50:12 +01:00
rustc_error_messages Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_errors Auto merge of #128465 - GrigorenkoPV:128200, r=estebank 2024-08-08 09:59:09 +00:00
rustc_expand refactor(rustc_expand::mbe): Don't require full ExtCtxt when not necessary 2024-08-07 21:58:05 +02:00
rustc_feature Rollup merge of #127655 - RalfJung:invalid_type_param_default, r=compiler-errors 2024-08-05 05:40:19 +02:00
rustc_fluent_macro Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_fs_util Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_graphviz Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_hir Rollup merge of #128377 - veera-sivarajan:fix-128249, r=davidtwco 2024-08-06 20:23:39 +02:00
rustc_hir_analysis Rollup merge of #128424 - fee1-dead-contrib:fx-clean, r=oli-obk 2024-08-07 15:59:35 +02:00
rustc_hir_pretty Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_hir_typeck Rollup merge of #128520 - compiler-errors:more-precisely-force-move, r=BoxyUwU 2024-08-07 20:49:02 -05:00
rustc_incremental Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_index Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_index_macros Remove usage of specialization from newtype_index! 2024-06-30 16:42:53 +00:00
rustc_infer Use Vec in instantiate_binder_with_fresh_vars 2024-07-29 14:38:33 +03:00
rustc_interface Auto merge of #127543 - carbotaniuman:more_unsafe_attr_verification, r=estebank,traviscross 2024-08-01 10:40:45 +00:00
rustc_lexer Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_lint Auto merge of #128796 - matthiaskrgr:rollup-r7l68ph, r=matthiaskrgr 2024-08-07 20:00:29 +00:00
rustc_lint_defs Disallow setting built-in cfgs via set the command-line 2024-08-07 14:08:34 +02:00
rustc_llvm Disable MC/DC tests on LLVM 19 2024-07-30 10:22:48 +02:00
rustc_log Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_macros Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_metadata Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_middle Disallow enabling features without their implied features 2024-08-07 00:45:00 -04:00
rustc_mir_build Disallow enabling features without their implied features 2024-08-07 00:45:00 -04:00
rustc_mir_dataflow Stop using MoveDataParamEnv for places that don't need a param-env 2024-07-29 11:59:47 -04:00
rustc_mir_transform Hide implicit target features from diagnostics when possible 2024-08-07 00:43:52 -04:00
rustc_monomorphize MIR required_consts, mentioned_items: ensure we do not forget to fill these lists 2024-08-01 15:49:25 +02:00
rustc_next_trait_solver Elaborate supertraits in dyn candidates 2024-08-05 10:03:17 -04:00
rustc_parse Rollup merge of #127921 - spastorino:stabilize-unsafe-extern-blocks, r=compiler-errors 2024-08-03 20:51:51 +02:00
rustc_parse_format Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_passes Rollup merge of #128552 - s7tya:check-no-sanitize-attribute-pos, r=BoxyUwU 2024-08-07 20:49:02 -05:00
rustc_pattern_analysis Use a separate pattern type for rustc_pattern_analysis diagnostics 2024-07-31 16:03:27 +10:00
rustc_privacy Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_query_impl Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_query_system chore: use shorthand initializer 2024-08-02 13:22:28 -04:00
rustc_resolve Auto merge of #128550 - compiler-errors:shadowed-params-perf, r=petrochenkov 2024-08-08 01:46:21 +00:00
rustc_sanitizers Use ParamEnv::reveal_all in CFI 2024-08-02 23:24:50 -04:00
rustc_serialize Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_session Rollup merge of #128702 - yaahc:metrics-flag, r=estebank 2024-08-07 20:49:03 -05:00
rustc_smir Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_span Rollup merge of #125048 - dingxiangfei2009:stable-deref, r=amanieu 2024-08-07 00:34:11 +02:00
rustc_symbol_mangling Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_target Fix typo 2024-08-07 00:43:56 -04:00
rustc_trait_selection Rollup merge of #128527 - estebank:ambiguity-suggestion, r=Nadrieril 2024-08-07 15:59:36 +02:00
rustc_traits Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_transmute Reformat use declarations. 2024-07-29 08:26:52 +10:00
rustc_ty_utils Auto merge of #128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 2024-07-30 17:49:08 +00:00
rustc_type_ir Auto merge of #128689 - matthiaskrgr:rollup-ukyn8wq, r=matthiaskrgr 2024-08-05 17:03:58 +00:00
rustc_type_ir_macros Reformat use declarations. 2024-07-29 08:26:52 +10:00
stable_mir Reformat use declarations. 2024-07-29 08:26:52 +10:00