rust/compiler
Matthias Krüger 305508f969
Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors
TypingMode: merge intercrate, reveal, and defining_opaque_types

This adds `TypingMode` and uses it in most places. We do not yet remove `Reveal` from `param_env`s. This and other future work as tracked in #132279 and via `FIXME`s.

Fetching the `TypingMode` of the `InferCtxt` asserts that the `TypingMode` agrees with `ParamEnv::reveal` to make sure we don't introduce any subtle bugs here. This will be unnecessary once `ParamEnv::reveal` no longer exists.

As the `TypingMode` is now a part of the query input, I've merged the coherence and non-coherence caches for the new solver. I've also enabled the local `infcx` cache during coherence by clearing the cache when forking it with a different `TypingMode`.

#### `TypingMode::from_param_env`

I am using this even in cases where I know that the `param_env` will always be `Reveal::UserFacing`. This is to make it easier to correctly refactor this code in the future, any time we use `Reveal::UserFacing` in a body while not defining its opaque types is incorrect and should use a `TypingMode` which only reveals opaques defined by that body instead, cc #124598

r? ``@compiler-errors``
2024-10-30 06:40:34 +01:00
..
rustc
rustc_abi Rollup merge of #132255 - workingjubilee:layout-is-🏚️, r=compiler-errors 2024-10-28 10:18:50 -07:00
rustc_arena
rustc_ast fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
rustc_ast_ir
rustc_ast_lowering Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_ast_passes
rustc_ast_pretty fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
rustc_attr
rustc_baked_icu_data
rustc_borrowck TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_builtin_macros
rustc_codegen_cranelift
rustc_codegen_gcc
rustc_codegen_llvm Rollup merge of #132319 - Zalathar:add-module-flag, r=jieyouxu 2024-10-29 18:38:59 +01:00
rustc_codegen_ssa TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_const_eval TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_data_structures
rustc_driver
rustc_driver_impl fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
rustc_error_codes Auto merge of #132145 - RalfJung:stdarch, r=Amanieu 2024-10-28 16:25:56 +00:00
rustc_error_messages
rustc_errors Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_expand Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_feature Rollup merge of #131984 - dingxiangfei2009:stabilize-if-let-rescope, r=traviscross,lcnr 2024-10-29 18:38:57 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir
rustc_hir_analysis Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
rustc_hir_pretty
rustc_hir_typeck Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
rustc_incremental
rustc_index
rustc_index_macros
rustc_infer TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_interface fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
rustc_lexer
rustc_lint Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
rustc_lint_defs
rustc_llvm Rollup merge of #132319 - Zalathar:add-module-flag, r=jieyouxu 2024-10-29 18:38:59 +01:00
rustc_log
rustc_macros
rustc_metadata Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_middle TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_mir_build Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
rustc_mir_dataflow
rustc_mir_transform TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_monomorphize
rustc_next_trait_solver remove outdated debug_assertion 2024-10-29 17:01:24 +01:00
rustc_parse fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
rustc_parse_format
rustc_passes TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_pattern_analysis
rustc_privacy
rustc_query_impl
rustc_query_system fix clippy::clone_on_ref_ptr for compiler 2024-10-28 18:05:08 +03:00
rustc_resolve Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_sanitizers
rustc_serialize
rustc_session Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_smir stable_mir: Directly use types from rustc_abi 2024-10-28 10:13:19 -07:00
rustc_span Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillot 2024-10-29 03:11:39 -07:00
rustc_symbol_mangling
rustc_target
rustc_trait_selection Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
rustc_traits TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_transmute Rollup merge of #132255 - workingjubilee:layout-is-🏚️, r=compiler-errors 2024-10-28 10:18:50 -07:00
rustc_ty_utils TypingMode 🤔 2024-10-29 17:01:24 +01:00
rustc_type_ir Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
rustc_type_ir_macros
stable_mir