Skip to content

Commit 0a1bdd4

Browse files
committed
test .await while holding variables of different sizes
1 parent a17951c commit 0a1bdd4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/test/ui/async-await/async-fn-size-moved-locals.rs

+18
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,27 @@ async fn joined_with_noop() {
9393
joiner.await
9494
}
9595

96+
async fn mixed_sizes() {
97+
let a = BigFut::new();
98+
let b = BigFut::new();
99+
let c = BigFut::new();
100+
let d = BigFut::new();
101+
let e = BigFut::new();
102+
let joiner = Joiner {
103+
a: Some(a),
104+
b: Some(b),
105+
c: Some(c),
106+
};
107+
108+
d.await;
109+
e.await;
110+
joiner.await;
111+
}
112+
96113
fn main() {
97114
assert_eq!(1028, std::mem::size_of_val(&single()));
98115
assert_eq!(1032, std::mem::size_of_val(&single_with_noop()));
99116
assert_eq!(3084, std::mem::size_of_val(&joined()));
100117
assert_eq!(3084, std::mem::size_of_val(&joined_with_noop()));
118+
assert_eq!(7188, std::mem::size_of_val(&mixed_sizes()));
101119
}

0 commit comments

Comments
 (0)