-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change NormalizesTo
to fully structurally normalize
#123363
Conversation
rustbot has assigned @compiler-errors. Use |
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
a76a780
to
209632a
Compare
TODO: this currently negatively affects perf because the structural norm is now nested alias-relate -> normalizes-to -> alias-relate. Intend to change |
r? @BoxyUwU |
209632a
to
8c96795
Compare
Actually doesn't really negatively affect perf compared to the previous impl 🤔 trying the separate approach ends up causing worse perf by propagating more nested goals upwards, causing us to spend a lot more time in |
8c96795
to
92b280c
Compare
@bors r+ rollup=never |
i mean @bors rollup=always (new solver) |
…BoxyUwU change `NormalizesTo` to fully structurally normalize notes in https://hackmd.io/wZ016dE4QKGIhrOnHLlThQ need to also update the dev-guide once this PR lands. in short, the setup is now as follows: `normalizes-to` internally implements one step normalization, applying that normalization to the `goal.predicate.term` causes the projected term to get recursively normalized. With this `normalizes-to` normalizes until the projected term is rigid, meaning that we normalize as many steps necessary, but at least 1. To handle rigid aliases, we add another candidate only if the 1 to inf step normalization failed. With this `normalizes-to` is now full structural normalization. We can now change `AliasRelate` to simply emit `normalizes-to` goals for the rhs and lhs. This avoids the concerns from rust-lang/trait-system-refactor-initiative#103 and generally feels cleaner
notes in https://hackmd.io/wZ016dE4QKGIhrOnHLlThQ
need to also update the dev-guide once this PR lands. in short, the setup is now as follows:
normalizes-to
internally implements one step normalization, applying that normalization to thegoal.predicate.term
causes the projected term to get recursively normalized. With thisnormalizes-to
normalizes until the projected term is rigid, meaning that we normalize as many steps necessary, but at least 1.To handle rigid aliases, we add another candidate only if the 1 to inf step normalization failed. With this
normalizes-to
is now full structural normalization. We can now changeAliasRelate
to simply emitnormalizes-to
goals for the rhs and lhs.This avoids the concerns from rust-lang/trait-system-refactor-initiative#103 and generally feels cleaner