about summary refs log tree commit diff
path: root/src/libstd/future.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-17/+0
2020-05-22Add core::future::IntoFutureYoshua Wuyts-1/+13
This patch adds `core::future::IntoFuture`. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering. That integration should be done in a follow-up PR.
2020-04-25Bump bootstrap compilerMark Rousskov-106/+0
2020-03-17Add futures scaffolding to libcoreJonas Schievink-7/+18
2020-03-15Bump the bootstrap compilerJonas Schievink-4/+1
2020-02-14Fix tests after rebaseMatthew Jasper-1/+2
2020-02-02Add a resume type parameter to `Generator`Jonas Schievink-1/+4
2019-12-31Revert "core: add IntoFuture trait and support for await"Wesley Wiser-5/+1
This reverts commit f35517ee861dc012ccc26083dd4520045e2c4f6f.
2019-12-27core: add IntoFuture trait and support for awaitSean McArthur-1/+5
2019-12-22Format the worldMark Rousskov-7/+6
2019-12-08async/await: more improvements to non-send errorsDavid Wood-1/+0
Signed-off-by: David Wood <david@davidtw.co>
2019-11-13Remove some stack frames from `.async` callsSteven Fackler-33/+12
The `Context` argument is currently smuggled through TLS for async-generated futures. The current infrastructure is closure-based, and results in an extra 6 stack frames when .awaiting an async-generated future! ``` 12: foo::async_b::{{closure}} at src/main.rs:10 13: <std::future::GenFuture<T> as core::future::future::Future>::poll::{{closure}} at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:43 14: std::future::set_task_context at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:79 15: <std::future::GenFuture<T> as core::future::future::Future>::poll at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:43 16: std::future::poll_with_tls_context::{{closure}} at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:121 17: std::future::get_task_context at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:111 18: std::future::poll_with_tls_context at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/future.rs:121 19: foo::async_a::{{closure}} at src/main.rs:6 ``` While the long (medium?) term solution is to remove the use of TLS entirely, we can improve things a bit in the meantime. In particular, this commit does 2 things: 1. `get_task_context` has been inlined into `poll_with_tls_context`, removing 2 frames (16 and 17 above). 2. `set_task_context` now returns a guard type that resets the TLS rather than taking a closure, removing 2 frames (13 and 14 above). We can also remove frame 18 by removing `poll_with_tls_context` in favor of a `get_task_context` function which returns a guard, but that requires adjusting the code generated for .await, so I've left that off for now.
2019-09-30async/await: improve obligation errorsDavid Wood-0/+1
This commit improves obligation errors for async/await: ``` note: future does not implement `std::marker::Send` because this value is used across an await --> $DIR/issue-64130-non-send-future-diags.rs:15:5 | LL | let g = x.lock().unwrap(); | - has type `std::sync::MutexGuard<'_, u32>` LL | baz().await; | ^^^^^^^^^^^ await occurs here, with `g` maybe used later LL | } | - `g` is later dropped here ``` Signed-off-by: David Wood <david@davidtw.co>
2019-06-04Hide gen_future API from documentationWim Looman-0/+6
2019-04-23Stabilize futures_apiTaylor Cramer-0/+1
2019-04-05Future-proof the Futures APITaylor Cramer-25/+36
2019-02-03Update the future/task APIMatthias Einwag-10/+10
This change updates the future and task API as discussed in the stabilization RFC at https://github.com/rust-lang/rfcs/pull/2592. Changes: - Replacing UnsafeWake with RawWaker and RawWakerVtable - Removal of LocalWaker - Removal of Arc-based Wake trait
2019-01-27Change generator trait to use pinningWim Looman-1/+3
2019-01-23Fix std::future::from_generator documentationAaron Hill-1/+1
This function takes a generator and wraps it in a future, not vice-versa.
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-21Update Pin API to match the one proposed for stabilizationTaylor Cramer-1/+1
Remove pin::Unpin reexport and add Unpin to the prelude. Change Pin associated functions to methods. Rename get_mut_unchecked_ to get_unchecked_mut Remove impl Unpin for Pin Mark Pin repr(transparent)
2018-11-28fix futures aliasing mutable and shared refRalf Jung-2/+2
2018-09-19Remove spawning from task::ContextTaylor Cramer-32/+27
2018-09-01Update to a new pinning API.Without Boats-5/+5
2018-08-23move PinMut into pin module and export through stdNiv Kaminer-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-02Remove unnecessary local in await! macroTaylor Cramer-2/+2
2018-06-23`PinMut`: Add safe `get_mut` and rename unsafe fns to `get_mut_unchecked` ↵Josef Reinhard Brandl-1/+1
and `map_unchecked`
2018-06-22Remove impl trait names and move bits of await into a functionTaylor Cramer-10/+20
2018-06-22Review nits and updatesTaylor Cramer-0/+106
Move future_from_generator out of raw Update await to use $crate Renumber errors
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-210/+0
This only changes the directory names; it does not change the "real" metadata names.
2013-05-19Use assert_eq! rather than assert! where possibleCorey Richardson-7/+7
2013-05-18auto merge of #6577 : brson/rust/io-upstream, r=pcwaltonbors-7/+3
r? This is all of my scheduler work on #4419 from the last 3 weeks or so. I've had a few failed pull requests so far but I think the problems are ironed out. * TCP * The beginnings of runtime embedding APIs * Porting various corners of core to be compatible with both schedulers * libuv timer bindings * Further refinement of I/O error handling, including a new, incomplete, `read_error` condition * Incomplete refactoring to make tasks work without coroutines and user-space scheduling * Implementations of Reader/Writer extension methods * Implementations of the most important part of core::comm I'm particularly happy with how easy the [comm types on top of the scheduler](https://github.com/brson/rust/blob/io-upstream/src/libcore/rt/comm.rs). Note that these implementations do not use pipes. If anything here needs careful review though it's this code. This branch passes 95% of the run-pass tests (with `TESTARGS=--newrt`) In the next week I'll probably spend some time adding preliminary multithreading and seeing how close we are to removing the old runtime.
2013-05-18Remove trailing whitespacesOlivier Saut-1/+1
2013-05-17core: Wire up oneshot pipes to newschedBrian Anderson-7/+3
2013-05-17Correct the example given for a future, add punctuation where necessaryOlivier Saut-6/+8
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-2/+2
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-11Warning policeTim Chevalier-38/+2
2013-05-10Stop using the '<->' operatorAlex Crichton-4/+3
2013-05-09remove vecs_implicitly_copyable from libstd/libcoreDaniel Micay-2/+2
2013-05-08libcore: Fix tests.Patrick Walton-3/+4
2013-05-08librustc: Fix merge fallout.Patrick Walton-0/+7
2013-05-08libstd: Remove mutable fields from future and parPatrick Walton-21/+56
2013-05-04Register snapshotsBrian Anderson-29/+0
2013-05-03std: Warning policeTim Chevalier-1/+1
2013-04-29test: Fix more tests.Patrick Walton-1/+1
2013-04-29librustc: Forbid type implementations on typedefs.Patrick Walton-7/+6
2013-04-27only use #[no_core] in libcoreDaniel Micay-2/+0
2013-04-16libcore,std,syntax,rustc: move tests into `mod tests`, make them private (no ↵Huon Wilson-9/+9
pub mod or pub fn).
2013-04-10libstd: changes to in response to #5656Niko Matsakis-1/+29