You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #162461 - jdonszelmann:restrict-fold-predicate, r=BoxyUwU
limit the api of `fold_predicate` and `visit_predicate`
r? @lcnr or anyone in @rust-lang/initiative-trait-system-refactor
In the future, we may want to start compressing clauses in the `ParamEnv`. One major problem was that we are leaking too many implementation details in `fold_predicate` and `visit_predicate`. Almost no code actually cares about dealing with an actual predicate there. Instead, what really matters is the type flags on a predicate for example. As such, this PR majorly limits the API that is exposed to a folder, hiding the underlying predicate data structure used.
As an example why this matters: in the case of compressed clauses, this will mean we won't need to "decompress" them. Instead, we can just fold over the self type, not telling folders whether the predicate was or was not compressed at all.
> [!NOTE]
> I've not used an LLM for any part of this PR, or any other PR I make. This includes any related work like research.
0 commit comments