rust/library/core/src
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 Rollup merge of #107916 - reez12g:issue-107040, r=Amanieu 2023-05-30 12:57:38 +02:00
array Remove array_zip 2023-05-30 00:40:39 -07:00
ascii Add the basic ascii::Char type 2023-05-03 22:09:33 -07:00
async_iter use consistent terminology 2022-10-29 09:23:12 +02:00
cell replace version placeholders 2023-04-28 08:47:55 -07:00
char ascii::Char-ify the escaping code 2023-05-12 19:37:02 -07:00
cmp Merge two different equality specialization traits in core 2023-03-01 14:42:06 -08:00
convert remove reference to Into in ? operator core/std docs, fix 111655 2023-05-31 15:51:28 +01:00
ffi Bump to latest beta compiler 2023-05-30 08:00:10 -04:00
fmt Mark internal functions and traits unsafe 2023-05-15 14:31:00 -04:00
future tidy 2023-05-19 12:45:41 +02:00
hash Swap out CURRENT_RUSTC_VERSION to 1.71.0 2023-05-30 07:54:29 -04:00
intrinsics Documentation 2023-05-15 12:08:16 +02:00
iter Make TrustedStep require Copy 2023-05-29 13:19:47 -07:00
macros [RFC-2011] Expand more expressions 2023-05-24 21:15:50 -03:00
mem Require that const param tys implement ConstParamTy 2023-06-01 18:03:59 +00:00
net Inline SocketAddr methods 2023-05-03 11:56:55 +02:00
num Swap out CURRENT_RUSTC_VERSION to 1.71.0 2023-05-30 07:54:29 -04:00
ops Auto merge of #103413 - RalfJung:phantom-dropck, r=lcnr 2023-05-13 00:23:51 +00:00
panic Rollup merge of #108356 - gftea:master, r=workingjubilee 2023-05-15 17:12:44 +02:00
prelude Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
ptr Auto merge of #111567 - Urgau:uplift_cast_ref_to_mut, r=b-naber 2023-06-01 01:27:32 +00:00
slice Swap out CURRENT_RUSTC_VERSION to 1.71.0 2023-05-30 07:54:29 -04:00
str Add invalid_from_utf8 analogous to invalid_from_utf8_unchecked 2023-05-27 00:18:28 +02:00
sync replace version placeholders 2023-04-28 08:47:55 -07:00
task Auto merge of #96875 - SabrinaJewson:noop-waker, r=m-ou-se 2023-06-07 06:04:32 +00:00
unicode Use hex literal for INDEX_MASK 2023-03-21 09:59:47 +01:00
any.rs Remove structural match from TypeId. 2023-05-25 20:15:39 +02:00
arch.rs move core::arch into separate file 2022-11-20 10:28:14 +01:00
ascii.rs ascii::Char-ify the escaping code 2023-05-12 19:37:02 -07:00
asserting.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
bool.rs core is now compilable 2023-04-16 07:20:26 +00:00
borrow.rs rm const traits in libcore 2023-04-16 06:49:27 +00:00
cell.rs Fix typo in std::cell module docs 2023-06-02 15:30:40 +03:30
clone.rs core is now compilable 2023-04-16 07:20:26 +00:00
cmp.rs Add #[inline] to functions that are never called 2023-05-07 12:41:37 +01:00
default.rs rm const traits in libcore 2023-04-16 06:49:27 +00:00
error.md Small round of typo fixes 2022-11-04 20:06:18 -07:00
error.rs Bump to latest beta 2023-03-15 08:55:22 -04:00
escape.rs ascii::Char-ify the escaping code 2023-05-12 19:37:02 -07:00
hint.rs Rollup merge of #108416 - pat-nel87:Issue-107957-black_box_docs, r=jyn514 2023-04-26 01:55:49 -05:00
internal_macros.rs rm const traits in libcore 2023-04-16 06:49:27 +00:00
intrinsics.rs Bump to latest beta compiler 2023-05-30 08:00:10 -04:00
lib.rs Auto merge of #111524 - scottmcm:escape-using-ascii, r=cuviper 2023-05-20 04:43:17 +00:00
marker.rs Impl ConstParamTy for tuples, make PartialStructuralEq a supertrait too 2023-06-01 18:21:42 +00:00
option.rs Rollup merge of #109093 - Dante-Broggi:patch-2, r=joshtriplett 2023-06-04 13:21:25 +02:00
panic.rs Shorten lifetime of even more panic temporaries 2023-05-15 03:47:37 -07:00
panicking.rs handle cfg(bootstrap) 2023-04-28 08:47:55 -07:00
pin.rs Document Pin memory layout 2023-05-18 01:30:12 -04:00
primitive.rs mv std libs to library/ 2020-07-27 19:51:13 -05:00
primitive_docs.rs Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, r=Mark-Simulacrum 2023-05-08 04:50:28 +00:00
result.rs replace version placeholders 2023-04-28 08:47:55 -07:00
time.rs Use fmt::Alignment instead of fmt::rt::v1::Alignment. 2023-04-20 18:03:47 +02:00
tuple.rs Impl ConstParamTy for tuples, make PartialStructuralEq a supertrait too 2023-06-01 18:21:42 +00:00
unit.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00