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

Remove redundant match arm for RPITITs #113340

Closed
wants to merge 2 commits into from

Conversation

spastorino
Copy link
Member

@spastorino spastorino commented Jul 4, 2023

This goes on top of #112988.

r? @compiler-errors

@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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jul 4, 2023
@@ -122,13 +122,6 @@ fn variance_of_opaque(tcx: TyCtxt<'_>, item_def_id: LocalDefId) -> &[ty::Varianc
{
self.visit_opaque(*def_id, substs)
}
// FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty) check whether this is necessary
Copy link
Member

Choose a reason for hiding this comment

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

Are you certain that this is correct to remove, or did you just remove this because no UI tests failed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't it just equivalent to the previous arm?. Like in this new scheme, def_kind is going to be OpaqueTy so this branch is never gonna be exercised.

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure it's not being called on any of the GAT def ids?

Copy link
Member Author

@spastorino spastorino Jul 5, 2023

Choose a reason for hiding this comment

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

Ok, going to double check tomorrow. I guess you may be implying that for impls is executed because for traits shouldn't but I wouldn't be sure what would be the effect of calling this on impl's GAT. Going to check again tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

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

In any case, given that all test pass here would be good to come up with a test case that fails with this branch removed and works if we add this back.

Copy link
Member

Choose a reason for hiding this comment

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

For traits, walking the fn_sig will give you back projections, so it may happen. Yeah, this at least needs a bit more checking.

@bors
Copy link
Contributor

bors commented Jul 6, 2023

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

@spastorino spastorino changed the title Further cleanups for RPITITs Remove redundant match arm for RPITITs Jul 6, 2023
@spastorino
Copy link
Member Author

I've just rebased this PR and didn't yet properly go over the things we've discussed.

@bors
Copy link
Contributor

bors commented Jul 7, 2023

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

@spastorino
Copy link
Member Author

Closing because I was squashed one commit from this PR into #112988 and what's currently left here was superseeded by #113427.

@spastorino spastorino closed this Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. T-rustdoc Relevant to the rustdoc 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