test .await while holding variables of different sizes

This commit is contained in:
David Laban 2019-08-04 16:08:31 +01:00
parent a17951c4f8
commit 0a1bdd4a53

View File

@ -93,9 +93,27 @@ async fn joined_with_noop() {
joiner.await
}
async fn mixed_sizes() {
let a = BigFut::new();
let b = BigFut::new();
let c = BigFut::new();
let d = BigFut::new();
let e = BigFut::new();
let joiner = Joiner {
a: Some(a),
b: Some(b),
c: Some(c),
};
d.await;
e.await;
joiner.await;
}
fn main() {
assert_eq!(1028, std::mem::size_of_val(&single()));
assert_eq!(1032, std::mem::size_of_val(&single_with_noop()));
assert_eq!(3084, std::mem::size_of_val(&joined()));
assert_eq!(3084, std::mem::size_of_val(&joined_with_noop()));
assert_eq!(7188, std::mem::size_of_val(&mixed_sizes()));
}