-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
☔ The latest upstream changes (presumably #113377) made this pull request unmergeable. Please resolve the merge conflicts. |
I've just rebased this PR and didn't yet properly go over the things we've discussed. |
☔ The latest upstream changes (presumably #113308) made this pull request unmergeable. Please resolve the merge conflicts. |
This goes on top of #112988.
r? @compiler-errors