Change:
<!-- 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.

Discussion:
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,

} }; <del> let param_env = tcx.param_env(did); </del> for (local, decl) in body.local_decls.iter_enumerated() { // Ignore locals which are internal or not saved between yields. if !saved_locals.contains(local) || decl.internal {

<ins> // edition:2018 // run-pass #![allow(incomplete_features)] #![feature(generic_const_exprs)] #![allow(unused)] fn main() { let x = test(); } fn concat<const A: usize, const B: usize>(a: [f32; A], b: [f32; B]) -> [f32; A + B] { todo!() } async fn reverse<const A: usize>(x: [f32; A]) -> [f32; A] { todo!() } async fn test() { let a = [0.0]; let b = [1.0, 2.0]; let ab = concat(a,b); let ba = reverse(ab).await; println!("{:?}", ba); } </ins>