]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-62658.rs
Auto merge of #103217 - mejrs:track, r=eholk
[rust.git] / src / test / ui / async-await / issue-62658.rs
1 // This test created a generator whose size was not rounded to a multiple of its
2 // alignment. This caused an assertion error in codegen.
3
4 // build-pass
5 // edition:2018
6
7 async fn noop() {}
8
9 async fn foo() {
10     // This suspend should be the largest variant.
11     {
12         let x = [0u8; 17];
13         noop().await;
14         println!("{:?}", x);
15     }
16
17     // Add one variant that's aligned to 8 bytes.
18     {
19         let x = 0u64;
20         noop().await;
21         println!("{:?}", x);
22     }
23 }
24
25 fn main() {
26     let _ = foo();
27 }