-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Use BoundVar
more
#110025
Use BoundVar
more
#110025
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
@jackh726: Best reviewed one commit at a time. The individual commit messages explain what's happening. In the second commit, I have an "njn:" comment at a place where I added an assertion that I wasn't 100% certain about. It never fails during tests. This relates to this zulip thread. |
This comment has been minimized.
This comment has been minimized.
There are lots of conversions between integers and `BoundVars`. Some of these are unavoidable, but by storing bound vars as `BoundVar` rather than `u32` in a few places (e.g. `BoundRegionKind::BrAnon`, `BoundTyKind::Anon`) we reduce the number of conversions. It's also good to store these values with the more informative type. The commit also impls `AddAssign<usize>` for newtypes, to allow incrementing. Some of the Chalk types (e.g. `BoundVar` and `Placeholder`) use `usize` for bound vars. If they were change then more conversions could be avoided, but this is difficult because `chalk_ir` is a module outside the compiler.
3a14905
to
6bf028d
Compare
…thercote Remove u32 on BrAnon and BoundTyKind::Anon in favor of BoundVar on Placeholder types r? `@nnethercote` Better alternative to rust-lang#110025
☔ The latest upstream changes (presumably #110036) made this pull request unmergeable. Please resolve the merge conflicts. |
@nnethercote I assume this can be closed now that #110036 has landed? |
r? @jackh726