rust/library
bors 10b7e468f3 Auto merge of #96875 - SabrinaJewson:noop-waker, r=m-ou-se
Add `task::Waker::noop`

I have found myself reimplementing this function many times when I need a `Context` but don't have a runtime or `futures` to hand.

Prior art: [`futures::task::noop_waker`](https://docs.rs/futures/0.3/futures/task/fn.noop_waker.html) and [`futures::task::noop_waker_ref`](https://docs.rs/futures/0.3/futures/task/fn.noop_waker_ref.html)

Tracking issue: https://github.com/rust-lang/rust/issues/98286

Unresolved questions:
1. Should we also add `RawWaker::noop()`? (I don't think so, I can't think of a use case for it)
2. Should we also add `Context::noop()`? Depending on the future direction `Context` goes a "noop context" might not even make sense in future.
3. Should it be an associated constant instead? That would allow for `let cx = &mut Context::from_waker(&Waker::NOOP);` to work on one line which is pretty nice. I don't really know what the guideline is here.

r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs
2023-06-07 06:04:32 +00:00
..
alloc Remove ExtendWith and ExtendElement 2023-06-04 15:55:34 +02:00
backtrace@4245978ca8 PS Vita std support 2023-05-07 18:57:43 +03:00
core Auto merge of #96875 - SabrinaJewson:noop-waker, r=m-ou-se 2023-06-07 06:04:32 +00:00
panic_abort Remove unnecessary raw pointer in __rust_start_panic arg 2023-03-26 16:40:18 +00:00
panic_unwind Partial stabilisation of c_unwind 2023-04-29 13:01:44 +01:00
portable-simd Explicit set workspace.resolver = "1" 2023-05-31 00:08:11 +01:00
proc_macro fix TODO comments 2023-05-02 10:32:07 +00:00
profiler_builtins Fully stabilize NLL 2022-06-03 17:16:41 -04:00
rtstartup Remove custom frame info registration on i686-pc-windows-gnu 2022-08-23 16:12:58 +08:00
rustc-std-workspace-alloc Replace libstd, libcore, liballoc in line comments. 2022-12-30 14:00:42 +01:00
rustc-std-workspace-core
rustc-std-workspace-std
std Bumped libc version 2023-06-06 16:09:05 +03:00
stdarch@7e2cdc675b stdarch: update submodule, take 5 2023-05-08 19:03:55 +09:00
sysroot Add a sysroot crate to represent the standard library crates 2023-04-25 13:40:36 +02:00
test Auto merge of #111348 - ozkanonur:remove-hardcoded-rustdoc-flags, r=albertlarsan68,oli-obk 2023-05-27 04:20:44 +00:00
unwind Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiser 2023-04-11 20:28:45 -07:00