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

Uplift outlives components to rustc_type_ir #127386

Merged
merged 3 commits into from
Jul 6, 2024

Conversation

compiler-errors
Copy link
Member

We need this to uplift push_outlives_components, since the elaborator uses push_outlives_components to elaborate type outlives obligations and I want to uplift elaboration.

This ends up reworking and inlining a fair portion of the GenericArg::walk_shallow function, whose only callsite was this one. I believe I got the logic correct, but may be worthwhile to look at it closely just in case. Unfortunately github was too dumb to understand that this is a rename + change -- I could also rework the git history to split the "copy the file over" part from the actual logical changes if that makes this easier to review.

r? lcnr

@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@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. labels Jul 5, 2024
@compiler-errors compiler-errors changed the title Uplift outlives components Uplift outlives components to rustc_type_ir Jul 5, 2024
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while I feel like this doesn't necessary have to happen in this PR, I really think this should use a TypeVisitor instead. Computing the outlives components for trait objects is fairly non-trivial.

r=me on the existing changes

compiler/rustc_type_ir/src/outlives.rs Outdated Show resolved Hide resolved
@compiler-errors
Copy link
Member Author

I could turn this into a TypeVisitor. The exceptions should be fairly obvious in that case.

@compiler-errors
Copy link
Member Author

I'll do it in another PR tho since it's actually kinda gnarly because of this visited hashset we pass around

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Jul 6, 2024

📌 Commit c2a88ea has been approved by lcnr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 6, 2024
…mpiler-errors

Rollup of 4 pull requests

Successful merges:

 - rust-lang#127386 (Uplift outlives components to `rustc_type_ir`)
 - rust-lang#127405 (uplift `PredicateEmittingRelation`)
 - rust-lang#127410 (Correct description of E0502)
 - rust-lang#127417 (Show fnsig's unit output  explicitly when there is output diff in diagnostics)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dfc02d2 into rust-lang:master Jul 6, 2024
6 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 6, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 6, 2024
Rollup merge of rust-lang#127386 - compiler-errors:uplift-outlives-components, r=lcnr

Uplift outlives components to `rustc_type_ir`

We need this to uplift `push_outlives_components`, since the elaborator uses `push_outlives_components` to elaborate type outlives obligations and I want to uplift elaboration.

This ends up reworking and inlining a fair portion of the `GenericArg::walk_shallow` function, whose only callsite was this one. I believe I got the logic correct, but may be worthwhile to look at it closely just in case. Unfortunately github was too dumb to understand that this is a rename + change -- I could also rework the git history to split the "copy the file over" part from the actual logical changes if that makes this easier to review.

r? lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants