]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/issue-61793.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / async-await / issue-61793.rs
1 // This testcase used to ICE in codegen due to inconsistent field reordering
2 // in the generator state, claiming a ZST field was after a non-ZST field,
3 // while those two fields were at the same offset (which is impossible).
4 // That is, memory ordering of `(X, ())`, but offsets of `((), X)`.
5
6 // build-pass
7 // edition:2018
8
9 async fn foo<F>(_: &(), _: F) {}
10
11 fn main() {
12 foo(&(), || {});
13 async {
14 foo(&(), || {}).await;
15 };
16 }