summary refs log tree commit diff
path: root/tests/coverage/async2.rs
diff options
context:
space:
mode:
authorKevin Reid <kpreid@switchb.org>2024-01-14 16:18:44 -0800
committerKevin Reid <kpreid@switchb.org>2024-01-17 11:53:16 -0800
commit6f8a944ba4311cbcf5922132721095c226c6fbab (patch)
tree252049e0559fdc1eb0d6a358d638d168ecf491cc /tests/coverage/async2.rs
parent3deb9bbf84f6431ebcbb7cbdbe3d89bc2636bc1b (diff)
downloadrust-6f8a944ba4311cbcf5922132721095c226c6fbab.tar.gz
rust-6f8a944ba4311cbcf5922132721095c226c6fbab.zip
Change return type of unstable `Waker::noop()` from `Waker` to `&Waker`.
The advantage of this is that it does not need to be assigned to a
variable to be used in a `Context` creation, which is the most common
thing to want to do with a noop waker.

If an owned noop waker is desired, it can be created by cloning, but the
reverse is harder. Alternatively, both versions could be provided, like
`futures::task::noop_waker()` and `futures::task::noop_waker_ref()`, but
that seems to me to be API clutter for a very small benefit, whereas
having the `&'static` reference available is a large benefit.

Previous discussion on the tracking issue starting here:
https://github.com/rust-lang/rust/issues/98286#issuecomment-1862159766
Diffstat (limited to 'tests/coverage/async2.rs')
0 files changed, 0 insertions, 0 deletions