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

Fix an assertion failure in bind_generator_hidden_types_above. #111085

Closed
wants to merge 1 commit into from

Conversation

nnethercote
Copy link
Contributor

@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 May 2, 2023
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Not actually sure if this is a bandaid for an existing bug in -Zdrop-tracking-mir=yes

@@ -3016,6 +3016,7 @@ fn bind_generator_hidden_types_above<'tcx>(
counter += 1;
tcx.mk_re_late_bound(current_depth, br)
}
ty::RePlaceholder(_) => r,
Copy link
Member

Choose a reason for hiding this comment

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

Hmm... I don't think we're supposed to leak placeholder types here. They should all be erased here...

Copy link
Contributor

Choose a reason for hiding this comment

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

We perform substitution with solver-provided substs, so we can have any region that is allowed within substs.
It may be interesting to do the fold before substitution: substs cannot contain ReErased, and unsubstituted bty can only contain ReErased.

Copy link
Member

Choose a reason for hiding this comment

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

oh, so this is a case where we had a late bound lifetime that was bound deeper than the generator itself. huh, ok, maybe this is fine then.

@compiler-errors
Copy link
Member

Since I'm a bit busy to investigate the fix and/or minimize the repro for a more detailed understanding,

r? @cjgillot

@rustbot rustbot assigned cjgillot and unassigned compiler-errors May 2, 2023
@cjgillot cjgillot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2023
@nnethercote
Copy link
Contributor Author

Looks like this one fell through the cracks. @cjgillot, sounds like you think the fix is ok as written. But you marked it as waiting-on-author. So now I'm confused -- is the code ok as written?

@cjgillot
Copy link
Contributor

My suggestion is to perform the fold before substitution. The assertion would be correct then.

@bors
Copy link
Contributor

bors commented Sep 23, 2023

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

@nnethercote
Copy link
Contributor Author

@cjgillot: I see you fixed this in #107421, which means this PR can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

ICE: unexpected region: RePlaceholder(Placeholder with mir drop tracking
5 participants