about summary refs log tree commit diff
path: root/library/core/src/future/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-1/+2
async_drop_in_place::{closure}, scoped async drop added.
2025-02-15tidying up tidyprogressive-galib-4/+4
2025-02-15replaced the four occurrences of issue ="50547" inprogressive.galib-4/+4
library/core/src/future/mod.rs with issue = "none"
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-4/+4
2024-07-29Reformat `use` declarations.Nicholas Nethercote-12/+8
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-17Add tracking issue to async_drop APIDaria Sukhonina-1/+1
2024-05-01Step bootstrap cfgsMark Rousskov-2/+0
2024-04-16Add simple async drop glue generationzetanumbers-0/+6
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2023-10-20s/Generator/Coroutine/Oli Scherer-1/+1
2023-05-07Remove `identity_future` from stdlibArpad Borsos-7/+0
This function/lang_item was introduced in #104321 as a temporary workaround of future lowering. The usage and need for it went away in #104833. After a bootstrap update, the function itself can be removed from `std`.
2023-04-28handle cfg(bootstrap)Pietro Albini-1/+0
2023-03-08Remove `identity_future` indirectionArpad Borsos-5/+1
This was previously needed because the indirection used to hide some unexplained lifetime errors, which it turned out were related to the `min_choice` algorithm. Removing the indirection also solves a couple of cycle errors, large moves and makes async blocks support the `#[track_caller]` annotation.
2023-01-29Remove `GenFuture` from coreArpad Borsos-45/+0
The handling of async constructs in the compiler does not rely on `GenFuture` anymore since `1.67`, so this code can now be removed from `core`.
2023-01-19Transform async ResumeTy in generator transformArpad Borsos-0/+4
- Eliminates all the `get_context` calls that async lowering created. - Replace all `Local` `ResumeTy` types with `&mut Context<'_>`. The `Local`s that have their types replaced are: - The `resume` argument itself. - The argument to `get_context`. - The yielded value of a `yield`. The `ResumeTy` hides a `&mut Context<'_>` behind an unsafe raw pointer, and the `get_context` function is being used to convert that back to a `&mut Context<'_>`. Ideally the async lowering would not use the `ResumeTy`/`get_context` indirection, but rather directly use `&mut Context<'_>`, however that would currently lead to higher-kinded lifetime errors. See <https://github.com/rust-lang/rust/issues/105501>. The async lowering step and the type / lifetime inference / checking are still using the `ResumeTy` indirection for the time being, and that indirection is removed here. After this transform, the generator body only knows about `&mut Context<'_>`.
2022-12-28Update bootstrap cfgPietro Albini-3/+2
2022-12-19Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-8/+2
2022-12-06Replace usage of `ResumeTy` in async lowering with `Context`Arpad Borsos-2/+8
Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-8/+19
Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.
2022-11-09Allow and add `track_caller` to generatorsBryan Garza-0/+1
This patch allows the usage of the `track_caller` annotation on generators, as well as sets them conditionally if the parent also has `track_caller` set. Also add this annotation on the `GenFuture`'s `poll()` function.
2022-07-16Stabilize `future_poll_fn`Yuki Okushi-1/+1
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-30Stabilize `into_future`Yoshua Wuyts-1/+1
2022-02-21Rollup merge of #91192 - r00ster91:futuredocs, r=GuillaumeGomezMatthias Krüger-1/+8
Some improvements to the async docs The goal here is to make the docs overall a little bit more comprehensive and add more links between the things. One thing that's not working yet is the links to the keywords. Somehow I couldn't get them to work. r? ````@GuillaumeGomez```` do you know how I could get the keyword links to work?
2022-02-19Some improvements to the async docsr00ster91-1/+8
2021-12-07implement `core::future::join`Ibraheem Ahmed-0/+4
2021-10-30Add #[must_use] to remaining core functionsJohn Kugelman-0/+1
2020-11-05Fix even more URLsGuillaume Gomez-1/+1
2020-09-22Update library functions with stability attributesDylan MacKenzie-0/+1
This may not be strictly minimal, but all unstable functions also need a `rustc_const_unstable` attribute.
2020-09-15Fix stabilization marker for future_readiness_fnsYoshua Wuyts-2/+2
Moved it from 1.47.0 -> 1.48.0, which is the correct release for this to stabilize in
2020-09-12Auto merge of #74328 - yoshuawuyts:stabilize-future-readiness-fns, r=sfacklerbors-2/+2
Stabilize core::future::{pending,ready} This PR stabilizes `core::future::{pending,ready}`, tracking issue https://github.com/rust-lang/rust/issues/70921. ## Motivation These functions have been on nightly for three months now, and have lived as part of the futures ecosystem for several years. In that time these functions have undergone several iterations, with [the `async-std` impls](https://docs.rs/async-std/1.6.2/async_std/future/index.html) probably diverging the most (using `async fn`, which in hindsight was a mistake). It seems the space around these functions has been _thoroughly_ explored over the last couple of years, and the ecosystem has settled on the current shape of the functions. It seems highly unlikely we'd want to make any further changes to these functions, so I propose we stabilize. ## Implementation notes This stabilization PR was fairly straightforward; this feature has already thoroughly been reviewed by the libs team already in https://github.com/rust-lang/rust/pull/70834. So all this PR does is remove the feature gate.
2020-09-08Capitalize safety commentsFlying-Toast-1/+1
2020-08-26apply bootstrap cfgsPietro Albini-2/+2
2020-08-25Stabilize future readiness fnsYoshua Wuyts-2/+2
2020-08-16hir: introduce lang items for AST loweringDavid Wood-0/+2
This commit adds new lang items which will be used in AST lowering once `QPath::LangItem` is introduced. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
2020-07-27mv std libs to library/mark-0/+95