about summary refs log tree commit diff
path: root/library/alloc/src/task.rs
AgeCommit message (Collapse)AuthorLines
2024-12-05Stabilize noop_wakerEric Holk-1/+0
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
2024-11-10split up the first paragraph of doc comments for better summariesbinarycat-3/+5
2024-07-29Reformat `use` declarations.Nicholas Nethercote-3/+3
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-03-25lib: fix some unnecessary_cast clippy lintklensy-2/+2
warning: casting raw pointers to the same type and constness is unnecessary (`*mut V` -> `*mut V`) --> library\alloc\src\collections\btree\map\entry.rs:357:31 | 357 | let val_ptr = root.borrow_mut().push(self.key, value) as *mut V; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `root.borrow_mut().push (self.key, value)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting to the same type is unnecessary (`usize` -> `usize`) --> library\alloc\src\ffi\c_str.rs:411:56 | 411 | let slice = slice::from_raw_parts_mut(ptr, len as usize); | ^^^^^^^^^^^^ help: try: `len` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting raw pointers to the same type and constness is unnecessary (`*mut T` -> `*mut T`) --> library\alloc\src\slice.rs:516:25 | 516 | (buf.as_mut_ptr() as *mut T).add(buf.len()), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `buf.as_mut_ptr()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting raw pointers to the same type and constness is unnecessary (`*mut T` -> `*mut T`) --> library\alloc\src\slice.rs:537:21 | 537 | (buf.as_mut_ptr() as *mut T).add(buf.len()), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `buf.as_mut_ptr()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`) --> library\alloc\src\task.rs:151:13 | 151 | waker as *const (), | ^^^^^^^^^^^^^^^^^^ help: try: `waker` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting raw pointers to the same type and constness is unnecessary (`*const ()` -> `*const ()`) --> library\alloc\src\task.rs:323:13 | 323 | waker as *const (), | ^^^^^^^^^^^^^^^^^^ help: try: `waker` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting to the same type is unnecessary (`usize` -> `usize`) --> library\std\src\sys_common\net.rs:110:21 | 110 | assert!(len as usize >= mem::size_of::<c::sockaddr_in>()); | ^^^^^^^^^^^^ help: try: `len` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast warning: casting to the same type is unnecessary (`usize` -> `usize`) --> library\std\src\sys_common\net.rs:116:21 | 116 | assert!(len as usize >= mem::size_of::<c::sockaddr_in6>()); | ^^^^^^^^^^^^ help: try: `len` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
2024-02-26Generate original vtable and clone's vtable in the same CGUDavid Tolnay-0/+13
2024-02-10Remove the link.Kevin Reid-4/+5
2024-02-10URL-encode chars in fragment.Kevin Reid-1/+1
2024-02-10Additional doc links and explanation of `Wake`.Kevin Reid-3/+9
This is intended to clarify: * That `Wake` exists and can be used instead of `RawWaker`. * How to construct a `Waker` when you are looking at `Wake` (which was previously only documented in the example).
2024-01-20doc: fix some doctests after rebaseTomás Vallotton-2/+2
2024-01-20refactor: make waker mandatory.Tomás Vallotton-6/+10
This also removes * impl From<&Context> for ContextBuilder * Context::try_waker() The from implementation is removed because now that wakers are always supported, there are less incentives to override the current context. Before, the incentive was to add Waker support to a reactor that didn't have any.
2024-01-20fix: Apply suggestions from code reviewtvallotton-3/+3
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
2024-01-20chore: fix ci failuresTomás Vallotton-1/+1
2024-01-20chore: add tracking issue number to local waker featureTomás Vallotton-10/+12
2024-01-20fix: make LocalWake available in targets that don't support atomics by ↵Tomás Vallotton-7/+11
removing a #[cfg(target_has_atomic = ptr)]
2024-01-20feat: add try_waker and From<&mut Context> for ContextBuilder to allow the ↵Tomás Vallotton-9/+11
extention of contexts by futures
2024-01-20feat: add LocalWaker type, ContextBuilder type, and LocalWake trait.Tomás Vallotton-1/+164
2023-04-25Updating Wake example to use new 'pin!' macroMads Ravn-1/+2
2022-06-17Document the conditional existence of `alloc::sync` and `alloc::task`.Kevin Reid-0/+6
The wording is copied from `std::sync::atomic::AtomicPtr`, with additional advice on how to `#[cfg]` for it.
2021-04-22Document From implementations for Waker and RawWakerMichael Howell-0/+6
2021-02-20Update the bootstrap compilerJoshua Nelson-4/+0
Note this does not change `core::derive` since it was merged after the beta bump.
2021-02-03Stabilize the Wake traitYoshua Wuyts-7/+59
Co-Authored-By: Ashley Mannix <kodraus@hey.com>
2021-01-31Rollup merge of #79285 - yoshuawuyts:stabilize-arc_mutate_strong_count, ↵Jonas Schievink-2/+2
r=m-ou-se Stabilize Arc::{increment,decrement}_strong_count Tracking issue: https://github.com/rust-lang/rust/issues/71983 Stabilizes `Arc::{incr,decr}_strong_count`, enabling unsafely incrementing an decrementing the Arc strong count directly with fewer gotchas. This API was first introduced on nightly six months ago, and has not seen any changes since. The initial PR showed two existing pieces of code that would benefit from this API, and included a change inside the stdlib to use this. Given the small surface area, predictable use, and no changes since introduction, I'd like to propose we stabilize this. closes https://github.com/rust-lang/rust/issues/71983 r? `@Mark-Simulacrum` ## Links * [Initial implementation](https://github.com/rust-lang/rust/pull/70733) * [Motivation from #68700](https://github.com/rust-lang/rust/pull/68700#discussion_r396169064) * [Real world example in an executor](https://docs.rs/extreme/666.666.666666/src/extreme/lib.rs.html#13)
2021-01-15Don't mark `ineffective_unstable_trait_impl` as an internal lintJoshua Nelson-2/+4
It's not an internal lint: - It's not in the rustc::internal lint group - It's on unconditionally, because it actually lints `staged_api`, not the compiler This fixes a bug where `#[deny(rustc::internal)]` would warn that `rustc::internal` was an unknown lint.
2020-12-18Stabilize Arc::{incr,decr}_strong_countYoshua Wuyts-2/+2
2020-09-11Allow unstable From impl for [Raw]Waker.Mara Bos-0/+2
2020-08-18Move to intra-doc links for task.rs and vec.rsSurya Midatala-3/+1
2020-07-27mv std libs to library/mark-0/+91