Fix an assertion failure in bind_generator_hidden_types_above.#111085
Fix an assertion failure in bind_generator_hidden_types_above.#111085nnethercote wants to merge 1 commit intorust-lang:masterfrom
bind_generator_hidden_types_above.#111085Conversation
compiler-errors
left a comment
There was a problem hiding this comment.
Not actually sure if this is a bandaid for an existing bug in -Zdrop-tracking-mir=yes
| counter += 1; | ||
| tcx.mk_re_late_bound(current_depth, br) | ||
| } | ||
| ty::RePlaceholder(_) => r, |
There was a problem hiding this comment.
Hmm... I don't think we're supposed to leak placeholder types here. They should all be erased here...
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
Since I'm a bit busy to investigate the fix and/or minimize the repro for a more detailed understanding, r? @cjgillot |
|
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? |
|
My suggestion is to perform the fold before substitution. The assertion would be correct then. |
|
☔ The latest upstream changes (presumably #107421) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #110941.
r? @compiler-errors