diff options
author | Eliza Weisman <eliza@buoyant.io> | 2019-12-02 16:43:33 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-02 16:43:33 -0800 |
commit | 07451f8b94a8b867696ddc1c6b546774fe1e06e4 (patch) | |
tree | 2eb2572ffa09124258562ba9b209c144f64501bf /examples/Cargo.toml | |
parent | e87df0557da4e8f70f3939c77e84acddc25652ba (diff) |
task: relax 'static bound in `LocalSet::block_on` (#1882)
## Motivation
Currently, `tokio::task::LocalSet`'s `block_on` method requires the
future to live for the 'static lifetime. However, this bound is not
required — the future is wrapped in a `LocalFuture`, and then passed
into `Runtime::block_on`, which does _not_ require a `'static` future.
This came up while updating `tokio-compat` to work with version 0.2. To
mimic the behavior of `tokio` 0.1's `current_thread::Runtime::run`, we
want to be able to have a runtime block on the `recv` future from an
mpsc channel indicating when the runtime is idle. To support `!Send`
futures, as the old `current_thread::Runtime` did, we must do so inside
of a `LocalSet`. However, with the current bounds, we cannot await an
`mpsc::Receiver`'s `recv` future inside the `LocalSet::block_on` call.
## Solution
This branch removes the unnecessary `'static` bound.
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Diffstat (limited to 'examples/Cargo.toml')
0 files changed, 0 insertions, 0 deletions