File tree 1 file changed +4
-3
lines changed 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,10 @@ use std::future::Future;
11
11
async fn data_moved_async ( ) {
12
12
async fn helper ( mut data : Vec < u8 > , raw_pointer : * mut Vec < u8 > ) {
13
13
let raw_pointer2 = & mut data as * mut Vec < u8 > ;
14
- // When the Vec is moved into the generator upvar, that copies the Vec's
15
- // ptr+capacity+len that is on the stack. Because of that, the value of
16
- // `raw_pointer2` is different than that of `raw_pointer`.
14
+ // `raw_pointer` points to the original location where the Vec was stored in the caller.
15
+ // `data` is where that Vec (to be precise, its ptr+capacity+len on-stack data)
16
+ // got moved to. Those will usually not be the same since the Vec got moved twice
17
+ // (into the function call, and then into the generator upvar).
17
18
//
18
19
// When copy propagation is enabled for generator upvars, the pointer
19
20
// addresses should be equal, becouse there will no longer be a
You can’t perform that action at this time.
0 commit comments