rust/compiler/rustc_hir_analysis/src
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
..
check Rollup merge of #131856 - lcnr:typing-mode, r=compiler-errors 2024-10-30 06:40:34 +01:00
coherence TypingMode 🤔 2024-10-29 17:01:24 +01:00
collect Rollup merge of #132194 - compiler-errors:rpitit-super-wc, r=spastorino 2024-10-29 03:11:41 -07:00
errors Clarify implicit captures for RPITIT 2024-10-10 11:46:51 -07:00
hir_ty_lowering TypingMode 🤔 2024-10-29 17:01:24 +01:00
impl_wf_check TypingMode 🤔 2024-10-29 17:01:24 +01:00
outlives Implement const effect predicate in new solver 2024-10-24 09:46:36 +00:00
variance Add variances to RPITITs 2024-10-10 11:46:48 -07:00
autoderef.rs Swap Vec<PredicateObligation> to type alias 2024-10-12 15:17:08 +01:00
bounds.rs Effects cleanup 2024-10-26 10:19:07 +08:00
check_unused.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
collect.rs TypingMode 🤔 2024-10-29 17:01:24 +01:00
constrained_generic_params.rs Remove #[macro_use] extern crate tracing from rustc_hir_analysis. 2024-08-30 17:14:59 +10:00
delegation.rs Effects cleanup 2024-10-26 10:19:07 +08:00
errors.rs Hack out effects support for old solver 2024-10-28 21:42:14 +00:00
hir_wf_check.rs TypingMode 🤔 2024-10-29 17:01:24 +01:00
impl_wf_check.rs nightly feature tracking: get rid of the per-feature bool fields 2024-10-23 09:14:41 +01:00
lib.rs Hack out effects support for old solver 2024-10-28 21:42:14 +00:00