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.
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) |
| 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.
| // We need to follow any provided projetions into the type. | |
| // We need to follow any provided projections into the type. |
| 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.
| // 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.
| // 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