Change:
// get included in each variant that requested them in // GeneratorLayout. debug!("prefix = {:#?}", prefix); <del> let (outer_fields, promoted_offsets) = match prefix.fields { FieldPlacement::Arbitrary { mut offsets, .. } => { let offsets_b = offsets.split_off(discr_index + 1); </del> <ins> let (outer_fields, promoted_offsets, promoted_memory_index) = match prefix.fields { FieldPlacement::Arbitrary { mut offsets, memory_index } => { let mut inverse_memory_index = invert_mapping(&memory_index); // "a" (`0..b_start`) and "b" (`b_start..`) correspond to // "outer" and "promoted" fields respectively. let b_start = (discr_index + 1) as u32; let offsets_b = offsets.split_off(b_start as usize); </ins> let offsets_a = offsets; <del> let memory_index = recompute_memory_index(&offsets_a); let outer_fields = FieldPlacement::Arbitrary { offsets: offsets_a, memory_index }; (outer_fields, offsets_b) </del> <ins> // Disentangle the "a" and "b" components of `inverse_memory_index` // by preserving the order but keeping only one disjoint "half" each. // FIXME(eddyb) build a better abstraction for permutations, if possible. let inverse_memory_index_b: Vec<_> = inverse_memory_index.iter().filter_map(|&i| i.checked_sub(b_start)).collect(); inverse_memory_index.retain(|&i| i < b_start); let inverse_memory_index_a = inverse_memory_index; // Since `inverse_memory_index_{a,b}` each only refer to their // respective fields, they can be safely inverted let memory_index_a = invert_mapping(&inverse_memory_index_a); let memory_index_b = invert_mapping(&inverse_memory_index_b); let outer_fields = FieldPlacement::Arbitrary { offsets: offsets_a, memory_index: memory_index_a, }; (outer_fields, offsets_b, memory_index_b) </ins> } _ => bug!(), };

Discussion:
Unfortunately the error message is super thin and I can't provide the source of the project. Therefore it's also hard to provide a minimal reproducible example. Some hints: Yesterdays nightly (nightly-2019-06-11-x8664-apple-darwin) doesn't ICE The project makes heavy use of async/await. Therefore it might by related to that. I wondered whether it's about generator optimization from . However I also checked that out locally from their branch 2 days ago and built it myself, and it didn't crash. At that point I had all commits up to "Extract generatorlayout as a method" included, only the last commit which was later was missing.
Could you please test your code out with in (you'll need to build rustc yourself) and provide the more extensive backtrace?
I tried running that over the afternoon. Unfortunately something went wrong: Unfortunately that happened after around 1.5 hours of compilation. This machine here is definitely too slow for doing any reasonable rustc compilation :'(
Got it running by deleting enough libraries and rebuilding. Unfortunately it just prints exactly the same error message. I think the setting might already had been enabled as far as I can derive from the compiler output above:
I played around with my code and deleted stuff until I got a simple repro: It seems like the combination of the member function together with the closure parameter might be the culprit. A top level or a a "static" member function (without ) doesn't cause an ICE. This also crashes if is not an async function and thereby no is included at all:
Reduction of version: Reduction of non- version:
Note that you only need to get the backtrace ( is much more expensive). Maybe we even have builds with that enabled nowadays? Not sure though. EDIT: also, someone needs to do this on linux, the backtraces are probably broken on macOS.
triage: leaving unprioritized; assigning to with intent that they attach priority label as well as any Async-Await specific labels. Leaving nomination tag but hoping I'll remember to skip over it at this week's meeting.
Hi, any temporally way to check on this? My build for tests (just build, just tests) have been failed for days and I have no idea which part of my code caused this in a large code base.
I also see this in my project.

I built my own compiler with enabled for now, In case anyone is interested, this is what I get when building the non- version :
I've been investigating, and I believe this is caused by a subtle bug in . (EDIT: In short, we weren't listing ZST fields at the beginning of the layout anymore.) The reason didn't reproduce in their checkout of the branch is likely that the bug didn't show up until one of the last changes I made to the branch, responding to final review feedback before merging. Working on a fix and will have it up soon with more details.
Opened .