]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-62658.rs
Rollup merge of #63155 - mfkl:uwp-msvc, r=alexcrichton
[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 #![feature(async_await)]
8
9 async fn noop() {}
10
11 async fn foo() {
12     // This suspend should be the largest variant.
13     {
14         let x = [0u8; 17];
15         noop().await;
16         println!("{:?}", x);
17     }
18
19     // Add one variant that's aligned to 8 bytes.
20     {
21         let x = 0u64;
22         noop().await;
23         println!("{:?}", x);
24     }
25 }
26
27 fn main() {
28     let _ = foo();
29 }