-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Do not attempt to ascribe projections out of a ty var #55637
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Do not attempt to ascribe projections out of a ty var #55637
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
self, | ||
tcx: TyCtxt<'a, 'gcx, 'tcx>, | ||
elem: &ProjectionElem<'tcx, V, T>, | ||
mut handle_field: impl FnMut(&Self, &Field, &T) -> Result<Ty<'tcx>, E>) |
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.
Nit: rustfmt would put the )
on the next line.
@bors r+ |
📌 Commit 1bbaa55 has been approved by |
@pnkfelix and I were discussing this PR and we observed that it could cause problems if you have repeated type variables, e.g., |
discussed at T-compiler meeting. beta-accepting (with a wee bit of trepidation from @nagisa ) |
@bors p=1 (beta accepted) |
⌛ Testing commit 1bbaa55 with merge 041e18f00bcde960a131884b391f59a077a6b5a3... |
💔 Test failed - status-appveyor |
... that message ... sounds like a spurious failure to me ...? |
@bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 1bbaa55 has been approved by |
@bors r=nikomatsakis |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 1bbaa55 has been approved by |
@bors retry |
@bors p=1 (beta accepted) |
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.
Noticed some spell errors.
let mut projected_ty = PlaceTy::from_ty(ty); | ||
let ty = self.normalize(ty, locations); | ||
|
||
// We need to follow any provided projetions into the type. |
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.
// We need to follow any provided projetions into the type. | |
// We need to follow any provided projections into the type. |
@@ -151,17 +151,35 @@ impl AscribeUserTypeCx<'me, 'gcx, 'tcx> { | |||
debug!("relate_type_and_user_type: ty of def-id is {:?}", ty); | |||
let ty = self.normalize(ty); | |||
|
|||
let mut projected_ty = PlaceTy::from_ty(ty); | |||
// We need to follow any provided projetions into the type. |
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.
// We need to follow any provided projetions into the type. | |
// We need to follow any provided projections into the type. |
|
||
// rust-lang/rust#55552: The strategy pnkfelix landed in PR #55274 | ||
// (for ensuring that NLL respects user-provided lifetime annotations) | ||
// did not handle the case where the ascribed type has some expliit |
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.
// did not handle the case where the ascribed type has some expliit | |
// did not handle the case where the ascribed type has some explicit |
…rojections-out-of-a-ty-var, r=nikomatsakis Do not attempt to ascribe projections out of a ty var If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types. Fix #55552
☀️ Test successful - status-appveyor, status-travis |
If we encounter
_
ascribed to structural pattern like(a, b)
, just skip relate_types.Fix #55552