We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bc0875 commit ac015deCopy full SHA for ac015de
tests/ui/async-await/issue-96084.rs
@@ -0,0 +1,33 @@
1
+// run-pass
2
+// edition:2018
3
+
4
+use std::mem;
5
6
+async fn foo() {
7
+ let x = [0u8; 100];
8
+ async {}.await;
9
+ println!("{}", x.len());
10
+}
11
12
+async fn a() {
13
+ let fut = foo();
14
+ let fut = fut;
15
+ fut.await;
16
17
18
+async fn b() {
19
20
+ println!("{}", mem::size_of_val(&fut));
21
22
23
24
25
+fn main() {
26
+ assert_eq!(mem::size_of_val(&foo()), 102);
27
28
+ // 1 + sizeof(foo)
29
+ assert_eq!(mem::size_of_val(&a()), 103);
30
31
+ // 1 + (sizeof(foo) * 2)
32
+ assert_eq!(mem::size_of_val(&b()), 103);
33
0 commit comments