Use BoundVar more#110025
Closed
nnethercote wants to merge 2 commits into
Closed
Conversation
Collaborator
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
Contributor
Author
|
@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
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 7, 2023
…thercote Remove u32 on BrAnon and BoundTyKind::Anon in favor of BoundVar on Placeholder types r? `@nnethercote` Better alternative to rust-lang#110025
Collaborator
|
☔ The latest upstream changes (presumably #110036) made this pull request unmergeable. Please resolve the merge conflicts. |
Member
|
@nnethercote I assume this can be closed now that #110036 has landed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @jackh726