Change:
saved_locals: &GeneratorSavedLocals, ) { let did = body.source.def_id(); <del> let allowed_upvars = tcx.erase_regions(upvars); </del> <ins> let param_env = tcx.param_env(did); let allowed_upvars = tcx.normalize_erasing_regions(param_env, upvars); </ins> let allowed = match witness.kind() { <del> &ty::GeneratorWitness(s) => tcx.erase_late_bound_regions(s), </del> <ins> &ty::GeneratorWitness(interior_tys) => { tcx.normalize_erasing_late_bound_regions(param_env, interior_tys) } </ins> _ => { tcx.sess.delay_span_bug( body.span,

Discussion:
Error is with genericconstexprs : <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details<!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
I actually hit this same issue with capturing un-normalized types in generator interiors when playing around with . I think I know a fix. claim

<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --code from glacier <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
label +AsyncAwait-Triaged This looks like a probable const generics bug.
updated code: `

<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --This error will surface if the arg has been accessed at least once(i did this with ) and if there is an async function that is awaited in the body. If I remove the await for it will run as normal. This error happened while I was using actix-web so I reproduced the simplest version of my code. <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Maybe related to . label +requires-nightly +AsyncAwait-Triaged
Looks like someone used the wrong variable in one of the two places
I also meet this problem but was unable to reproduce it. The compiler complains about But here is , because = . I tried to play with this issue on my own project by replacing all occurrence of to , it would complain something like In this cause is one of the . It seems like this problem is because the generator is trying to find a type with a concrete name, but there are different corresponding name in MIR.
Minimised to: Interestingly, removing the braces around the 0 allows it to compile fine. Regression bisected to: 2021-03-28 <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.0</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailsBest guess is that it's an effect of:
In my case, I found out that it only breaks with .
When it is surrounded by {} it evaluates it, which as shown above is finding two separate symbols that don't match (that's what this issue is for)
Reproduced in 4 different builds on 2 different repos with nightly 2022-01-21. I am not sure if this is the same issue. Although the crash message says clippy, it seems to be a problem from the rustc code. Should I create a new issue?

That looks like a separate issue to me, so please do open a new issue (feel free to point back at this one as something similar).
Seems no longer reproduced on latest nightly, not sure if it is some update in the libraries or the rustc itself.

<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
could you share your code that caused the issue or a list of steps to reproduce the crash?
I try, but it may take some time.
this issue should no longer happen, could you verify it?