]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-61793.rs
Rollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se
[rust.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 }