Handle ReVar
in note_and_explain_region
by nnethercote · Pull Request #125054 · rust-lang/rust (original) (raw)
So the tl;dr is:
let reg_vid = self |
---|
.infcx |
.next_nll_region_var(FR, | |
.as_var(); |
We create an anonymous free region here for the VaListImpl<'_>
that c-variadic is implicitly lowered to.
Async functions capture that var arg list (not exactly certain how they end up doing that, though), and so the lifetime ends up being captured by the async fn's future. That ends up erroring because the future ends up capturing a lifetime that it didn't expect, which should probably not happen, but regardless is a problem because we have no way of providing a useful error message even if we don't expect it to work.
Probably won't be able to put up a PR to fix this, at least not tonight since it's 23:30, and am becoming more sympathetic to land this PR with a FIXME, a better PR title, and a follow-up issue filed about how the diagnostic isn't useful at all, so we can link it w/ the c_variadic
tracking issue at least. Do you want to do that?