rust/compiler
Guillaume Gomez 6f0d15a144
Rollup merge of #133610 - camelid:move-from_anon_const, r=BoxyUwU
Move `Const::{from_anon_const,try_from_lit}` to hir_ty_lowering

Fixes #128176.
This accomplishes one of the followup items from #131081.

These operations are much more about lowering the HIR than about
`Const`s themselves. They fit better in hir_ty_lowering with
`lower_const_arg` (formerly `Const::from_const_arg`) and the rest.

To accomplish this, `const_evaluatable_predicates_of` had to be changed
to not use `from_anon_const` anymore. Instead of visiting the HIR and
lowering anon consts on the fly, it now visits the `rustc_middle::ty`
data structures instead and directly looks for `UnevaluatedConst`s. This
approach was proposed in:
https://github.com/rust-lang/rust/pull/131081#discussion_r1821189257

r? `@BoxyUwU`
2024-12-02 23:08:54 +01:00
..
rustc
rustc_abi Auto merge of #130867 - michirakara:steps_between, r=dtolnay 2024-11-22 10:54:22 +00:00
rustc_arena
rustc_ast Eliminate magic numbers from expression precedence 2024-11-30 17:53:40 -08:00
rustc_ast_ir
rustc_ast_lowering Rollup merge of #133589 - voidc:remove-array-len, r=boxyuwu 2024-12-01 22:10:23 -05:00
rustc_ast_passes Refactor where predicates, and reserve for attributes support 2024-11-25 16:38:35 +08:00
rustc_ast_pretty Eliminate magic numbers from expression precedence 2024-11-30 17:53:40 -08:00
rustc_attr
rustc_baked_icu_data
rustc_borrowck uplift fold_regions to rustc_type_ir 2024-11-28 10:40:58 +01:00
rustc_builtin_macros update cfgs 2024-11-27 15:14:54 +00:00
rustc_codegen_cranelift Rollup merge of #133422 - taiki-e:riscv-e-clobber-abi, r=Amanieu 2024-11-28 12:06:01 +01:00
rustc_codegen_gcc Support #[repr(simd)] types in input/output of PowerPC inline assembly 2024-11-29 00:24:36 +09:00
rustc_codegen_llvm Rollup merge of #133446 - Zalathar:querify, r=cjgillot 2024-12-01 21:38:25 -05:00
rustc_codegen_ssa Rollup merge of #132974 - madsmtm:linker-arguments-with-commas, r=petrochenkov 2024-12-01 14:30:07 +01:00
rustc_const_eval Move always_storage_live_locals. 2024-11-26 12:05:57 +11:00
rustc_data_structures Add UnordMap::clear method 2024-11-20 18:11:37 +01:00
rustc_driver
rustc_driver_impl Rollup merge of #133590 - nnethercote:rename-parse-only, r=estebank 2024-11-29 10:19:00 +01:00
rustc_error_codes
rustc_error_messages
rustc_errors Eliminate magic numbers from expression precedence 2024-11-30 17:53:40 -08:00
rustc_expand Implement the unsafe-fields RFC. 2024-11-21 19:32:07 +01:00
rustc_feature Rollup merge of #116161 - Soveu:varargs2, r=cjgillot 2024-11-30 12:56:50 +08:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #133603 - dtolnay:precedence, r=lcnr 2024-12-02 17:36:03 +01:00
rustc_hir_analysis Rollup merge of #133610 - camelid:move-from_anon_const, r=BoxyUwU 2024-12-02 23:08:54 +01:00
rustc_hir_pretty Rollup merge of #133603 - dtolnay:precedence, r=lcnr 2024-12-02 17:36:03 +01:00
rustc_hir_typeck Rollup merge of #133751 - lcnr:no-trait-solving-on-type, r=compiler-errors 2024-12-02 17:36:11 +01:00
rustc_incremental
rustc_index Remove HybridBitSet. 2024-11-29 17:23:34 +11:00
rustc_index_macros Auto merge of #130867 - michirakara:steps_between, r=dtolnay 2024-11-22 10:54:22 +00:00
rustc_infer support revealing defined opaque post borrowck 2024-11-28 10:40:58 +01:00
rustc_interface Rollup merge of #133590 - nnethercote:rename-parse-only, r=estebank 2024-11-29 10:19:00 +01:00
rustc_lexer Revert "Reject raw lifetime followed by \' as well" 2024-12-01 05:22:16 +00:00
rustc_lint remove Ty::is_copy_modulo_regions 2024-12-02 13:57:56 +01:00
rustc_lint_defs Rollup merge of #133535 - RalfJung:forbidden_lint_groups-future-compat, r=davidtwco 2024-12-02 23:08:53 +01:00
rustc_llvm Respect verify-llvm-ir option in the backend 2024-11-26 15:26:03 +01:00
rustc_log
rustc_macros
rustc_metadata Rollup merge of #132750 - daltenty:daltenty/libs, r=jieyouxu 2024-11-30 12:56:50 +08:00
rustc_middle Rollup merge of #133610 - camelid:move-from_anon_const, r=BoxyUwU 2024-12-02 23:08:54 +01:00
rustc_mir_build remove Ty::is_copy_modulo_regions 2024-12-02 13:57:56 +01:00
rustc_mir_dataflow Stop using HybridBitSet in dataflow diffs. 2024-11-29 17:23:34 +11:00
rustc_mir_transform Rollup merge of #133751 - lcnr:no-trait-solving-on-type, r=compiler-errors 2024-12-02 17:36:11 +01:00
rustc_monomorphize Share inline(never) generics across crates 2024-11-28 13:43:05 -05:00
rustc_next_trait_solver support revealing defined opaque post borrowck 2024-11-28 10:40:58 +01:00
rustc_parse Rollup merge of #133603 - dtolnay:precedence, r=lcnr 2024-12-02 17:36:03 +01:00
rustc_parse_format
rustc_passes Refactor where predicates, and reserve for attributes support 2024-11-25 16:38:35 +08:00
rustc_pattern_analysis no more Reveal :( 2024-11-23 13:52:54 +01:00
rustc_privacy
rustc_query_impl Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillot 2024-11-27 22:23:24 +01:00
rustc_query_system Auto merge of #124780 - Mark-Simulacrum:lockless-cache, r=lcnr 2024-11-19 02:07:48 +00:00
rustc_resolve always create DefIds when lowering anon-consts 2024-11-28 12:22:02 +00:00
rustc_sanitizers use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
rustc_serialize
rustc_session impl Default for EarlyDiagCtxt 2024-12-02 09:55:04 -05:00
rustc_smir Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillot 2024-11-27 22:23:24 +01:00
rustc_span Rollup merge of #133686 - samueltardieu:push-xkxwxzxqokuu, r=compiler-errors 2024-12-01 08:15:25 +01:00
rustc_symbol_mangling additional TypingEnv cleanups 2024-11-19 21:36:23 +01:00
rustc_target Auto merge of #133684 - RalfJung:rollup-j2tmrg7, r=RalfJung 2024-11-30 21:08:45 +00:00
rustc_trait_selection Auto merge of #133760 - GuillaumeGomez:rollup-2c1y8c3, r=GuillaumeGomez 2024-12-02 18:36:36 +00:00
rustc_traits Delay a bug when encountering an impl with unconstrained generics in codegen_select 2024-11-23 05:27:45 +00:00
rustc_transmute use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
rustc_ty_utils remove Ty::is_copy_modulo_regions 2024-12-02 13:57:56 +01:00
rustc_type_ir Auto merge of #133566 - lcnr:fast-reject-perf, r=compiler-errors 2024-12-02 09:19:20 +00:00
rustc_type_ir_macros
stable_mir