Skip to content

Uplift outlives components to rustc_type_ir - #127386

Merged
bors merged 3 commits into
rust-lang:masterfrom
compiler-errors:uplift-outlives-components
Jul 6, 2024
Merged

Uplift outlives components to rustc_type_ir#127386
bors merged 3 commits into
rust-lang:masterfrom
compiler-errors:uplift-outlives-components

Conversation

@compiler-errors

Copy link
Copy Markdown
Contributor

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

rustbot commented Jul 5, 2024

Copy link
Copy Markdown
Collaborator

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

@lcnr lcnr left a comment

Copy link
Copy Markdown
Contributor

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

Comment thread compiler/rustc_type_ir/src/outlives.rs Outdated
@compiler-errors

Copy link
Copy Markdown
Contributor Author

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

@compiler-errors
compiler-errors force-pushed the uplift-outlives-components branch from aa76d30 to c2a88ea Compare July 6, 2024 15:05
@compiler-errors

Copy link
Copy Markdown
Contributor 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

bors commented Jul 6, 2024

Copy link
Copy Markdown
Collaborator

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