aloof-angle-91616
09/10/2020, 5:24 PMhundreds-father-404
09/10/2020, 5:25 PMaloof-angle-91616
09/10/2020, 5:25 PMaloof-angle-91616
09/10/2020, 5:26 PMwitty-crayon-22786
09/10/2020, 7:01 PMhundreds-breakfast-49010
09/10/2020, 9:53 PMaloof-angle-91616
09/10/2020, 9:54 PMaloof-angle-91616
09/10/2020, 9:55 PMaloof-angle-91616
09/10/2020, 9:55 PMhundreds-breakfast-49010
09/10/2020, 9:55 PM./pants --no-pantsd test <test target>
seems to have broken ctrl-c handlinghundreds-breakfast-49010
09/10/2020, 9:56 PM./pants --no-pantsd fmt src/python/pants::
hundreds-father-404
09/11/2020, 4:35 AMhundreds-father-404
09/11/2020, 4:35 AMerror[E0515]: cannot return value referencing local variable `file_contents_and_directories`
--> src/intrinsics.rs:364:3
|
331 | let digests: Vec<_> = file_contents_and_directories
| ----------------------------- `file_contents_and_directories` is borrowed here
...
364 | / async move {
365 | | let digests = future::try_join_all(digests).await.map_err(|e| throw(&e))?;
366 | | let digest = store
367 | | .merge(digests)
... |
371 | | }
372 | | .boxed()
| |__________^ returns a value referencing data owned by the current function
error: aborting due to previous error
For more information about this error, try `rustc --explain E0515`.
fast-nail-55400
09/11/2020, 5:09 AMmap
closure?fast-nail-55400
09/11/2020, 5:09 AMasync move
closure)fast-nail-55400
09/11/2020, 5:12 AMfile_contents_and_directories
fast-nail-55400
09/11/2020, 5:13 AMfuture::try_join_all(digests).await.map_err(|e| throw(&e))?;
fast-nail-55400
09/11/2020, 5:13 AMdigests
as a parameter refers to the binding to which the map is assigned, right?fast-nail-55400
09/11/2020, 5:14 AMhundreds-father-404
09/11/2020, 5:14 AMfile_values
to file_contents_and_directories
, but same type.
And then the async move {}
is more complex in that it has an if else
fast-nail-55400
09/11/2020, 5:14 AMhundreds-father-404
09/11/2020, 5:15 AMdigests as a parameter refers to the binding to which the map is assigned, right?Iiuc,
digests
takes ownership of the created Vec<Future<Result<Digest, String>>>
fast-nail-55400
09/11/2020, 5:16 AMfast-nail-55400
09/11/2020, 5:16 AMasync move
after digests
is bound earlier then, got ithundreds-father-404
09/11/2020, 5:16 AMfast-nail-55400
09/11/2020, 5:17 AMfast-nail-55400
09/11/2020, 5:19 AMdigests
?hundreds-father-404
09/11/2020, 5:19 AMfile_contents_and_directories
still ends up being referenced. I would think that after binding digests
, that file_contents_and_directories
is dropped
Maybe the issue is borrowing file_contents_and_directories
, and it shouldn’t borrow?fast-nail-55400
09/11/2020, 5:19 AMVec<&Digest>
?hundreds-father-404
09/11/2020, 5:20 AMwhat is the exact type of digests?According to Rustc:
std::vec::Vec<impl futures::Future>