mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-03 05:27:36 +00:00
![]() 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`` |
||
---|---|---|
.. | ||
check | ||
coherence | ||
collect | ||
errors | ||
hir_ty_lowering | ||
impl_wf_check | ||
outlives | ||
variance | ||
autoderef.rs | ||
bounds.rs | ||
check_unused.rs | ||
collect.rs | ||
constrained_generic_params.rs | ||
delegation.rs | ||
errors.rs | ||
hir_wf_check.rs | ||
impl_wf_check.rs | ||
lib.rs |