]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-61793.rs
Rollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievink
[rust.git] / src / test / 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 (FIXME(62277): could be check-pass?)
7 // edition:2018
8
9 async fn foo<F>(_: &(), _: F) {}
10
11 fn main() {
12     foo(&(), || {});
13     async {
14         foo(&(), || {}).await;
15     };
16 }