limit the api of fold_predicate and visit_predicate - #162461
Conversation
|
what does compressing clauses mean :3 |
|
haha, fair point: there's a plan to reduce the size of |
|
ah sick yeah that makes sense, follow up question, how far off is "in the future"? If this is just a first step in work that is actively ongoing to do that then this seems reasonable to me 🤔 If we have no active plans to do the perf work here this feels kinda meh to me as it makes the folder logic more abstract and harder to reason about. |
|
So I already have a prototype. We're still struggling a little, since it's essential for performance not to decompress these clauses all over the place. Previously, in the folders, we were simply lying and folding over only the self type, skipping In other words, this is the first step towards doing compression, something which is currently in the works, and this is its own PR since is mergeable as is. |
|
will just r? me :3 |
24be2a8 to
cb34499
Compare
|
changes to the core type system cc @lcnr |
cb34499 to
8622679
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r+ rollup |
…te, 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.
…uwer Rollup of 6 pull requests Successful merges: - #162309 (offload: automate manual clang-linker-wrapper step) - #160505 (delegation: supporting inherent impls) - #160712 (windows-gnullvm: always link libunwind statically) - #161423 (trait_selection: Keep type-op region constraints in borrowck) - #162461 (limit the api of `fold_predicate` and `visit_predicate`) - #162475 (Fix unsoundness bug on next trait solver for dyn const generics placeholder)
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.
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 infold_predicateandvisit_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.