mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
ed81098fcc
Minor improvements to `future::join!`'s implementation This is a follow-up from #91645, regarding [some remarks I made](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/join!/near/264293660). Mainly: - it hides the recursive munching through a private `macro`, to avoid leaking such details (a corollary is getting rid of the need to use ``@`` to disambiguate); - it uses a `match` binding, _outside_ the `async move` block, to better match the semantics from function-like syntax; - it pre-pins the future before calling into `poll_fn`, since `poll_fn`, alone, cannot guarantee that its capture does not move (to clarify: I believe the previous code was sound, thanks to the outer layer of `async`. But I find it clearer / more robust to refactorings this way 🙂). - it uses `@ibraheemdev's` very neat `.ready()?`; - it renames `Took` to `Taken` for consistency with `Done` (tiny nit 😄). ~~TODO~~Done: - [x] Add unit tests to enforce the function-like `:value` semantics are respected. r? `@nrc` |
||
---|---|---|
.. | ||
alloc | ||
backtrace@b02ed04a7e | ||
core | ||
panic_abort | ||
panic_unwind | ||
portable-simd | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@b70ae88ef2 | ||
test | ||
unwind |