Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

nnethercote
Copy link
Contributor

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 6, 2023
@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2023

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@nnethercote
Copy link
Contributor Author

nnethercote commented Apr 6, 2023

@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.

@rust-log-analyzer

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.
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
@bors
Copy link
Contributor

bors commented Apr 7, 2023

☔ The latest upstream changes (presumably #110036) made this pull request unmergeable. Please resolve the merge conflicts.

@jackh726
Copy link
Member

jackh726 commented Apr 9, 2023

@nnethercote I assume this can be closed now that #110036 has landed?

@jackh726 jackh726 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants