3465 Commits

Author SHA1 Message Date
Paul IP
11719721e9 perf: improve AtomicWaker::wake performance (#2983) 2026-01-21 22:58:28 +09:00
Caio
2bb9a288a9 Add #[clippy::has_significant_drop] to guards (#2967) 2026-01-21 00:09:58 +09:00
Paul-Nicolas Madelaine
27354944b0 Fix documentation of BiLock::lock (#2971) 2026-01-21 00:09:34 +09:00
Taiki Endo
c6b24ca936 Fix rustdoc::broken_intra_doc_links warning
```
error: unresolved link to `Box`
  --> futures-util/src/future/always_ready.rs:43:83
   |
43 | /// This is particularly useful in avoiding a heap allocation when an API needs [`Box<dyn Future<Output = T>>`],
   |                                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `Box` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
   = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

error: unresolved link to `stream.take`
  --> futures-util/src/stream/repeat_with.rs:43:7
   |
43 | /// [`stream.take()`], in order to make them finite.
   |       ^^^^^^^^^^^^^ no item named `stream.take` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: unresolved link to `stream.repeat`
  --> futures-util/src/stream/repeat_with.rs:47:11
   |
47 | /// the [`stream.repeat()`] function.
   |           ^^^^^^^^^^^^^^^ no item named `stream.repeat` in scope
   |
   = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: unresolved link to `futures-util::stream::select`
   --> futures-util/src/stream/select_with_strategy.rs:120:46
    |
120 | /// Note: this special case is provided by [`futures-util::stream::select`].
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `futures-util` in scope
```
2026-01-21 00:08:56 +09:00
Taiki Endo
e40bd058ef Fix clippy::derivable_impls warning
```
error: this `impl` can be derived
  --> futures-util/src/stream/select_with_strategy.rs:33:1
   |
33 | / impl Default for PollNext {
34 | |     fn default() -> Self {
35 | |         Self::Left
36 | |     }
37 | | }
   | |_^
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#derivable_impls
   = note: `-D clippy::derivable-impls` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::derivable_impls)]`
help: replace the manual implementation with a derive attribute and mark the default variant
   |
 9 + #[derive(Default)]
10 | pub enum PollNext {
11 |     /// Poll the first stream.
12 ~     #[default]
13 ~     Left,
   |
```
2026-01-21 00:08:56 +09:00
John Starks
de9274e655 futures-util: make Mutex::new() const (#2956)
This builds with the MSRV (1.68) and is convenient for creating `static`
mutexes.

This does bind the implementation to never allocate in `new` in the
future, but that seems like a desirable property anyway.

Note that this also requires updating slab to 0.4.7, which is the first
version that supports const `Slab::new()`.
2025-07-19 18:01:30 +09:00
Taiki Endo
b95f0ad111 ci: Test big-endian target (s390x Linux) 2025-07-19 17:59:55 +09:00
Taiki Endo
6be1b5a8a3 ci: Adjust scheduled CI 2025-07-19 17:59:55 +09:00
Taiki Endo
d275fc74f8 Ignore dead_code lint on Fn1 trait
```
error: trait `Fn1` is never used
  --> futures-util/src/fns.rs:34:11
   |
34 | pub trait Fn1<A>: FnMut1<A> {
   |           ^^^
   |
   = note: `-D dead-code` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(dead_code)]`
```
2025-07-19 17:59:55 +09:00
Taiki Endo
3116fdaa52 Fix unused_parens warning
```
error: unnecessary parentheses around type
  --> futures-util/src/future/future/remote_handle.rs:72:57
   |
72 | type SendMsg<Fut> = Result<<Fut as Future>::Output, Box<(dyn Any + Send + 'static)>>;
   |                                                         ^                        ^
   |
   = note: `-D unused-parens` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(unused_parens)]`
help: remove these parentheses
   |
72 - type SendMsg<Fut> = Result<<Fut as Future>::Output, Box<(dyn Any + Send + 'static)>>;
72 + type SendMsg<Fut> = Result<<Fut as Future>::Output, Box<dyn Any + Send + 'static>>;
   |
```
2025-07-19 17:59:55 +09:00
tison
07359ef832 chore: replace num_cpus with available_parallelism (#2946)
Signed-off-by: tison <wander4096@gmail.com>
2025-05-23 23:06:24 +09:00
Pavel Roskin
97ea37e704 select: add missing space in panic message (#2952) 2025-05-03 00:17:17 +09:00
Christian Schwarz
660f76fdca channel: Add recv (#2947) 2025-04-16 22:24:28 +09:00
tison
27c23a0f5d chore: remove deprecated pin_mut macro in 0.4 (#2945)
Signed-off-by: tison <wander4096@gmail.com>
2025-04-16 21:04:17 +09:00
Paolo Barbolini
215d4111b8 refactor: remove leftover from read_initializer feature (#2949) 2025-04-16 21:03:16 +09:00
Aatif Syed
142fdcbded feat: sink::With: Implement FusedStream (#2948) 2025-04-10 19:23:22 +09:00
Christian Schwarz
89e5d8b26c channel: Add try_recv and deprecate try_next (#2944) 2025-04-09 15:59:27 +09:00
tison
6f9a15f6e3 bump msrv to 1.68
Signed-off-by: tison <wander4096@gmail.com>
2025-04-07 22:46:27 +09:00
tison
ebb2dcb2d8 chore: replace all usage of pin_mut
Signed-off-by: tison <wander4096@gmail.com>
2025-04-07 22:46:27 +09:00
tison
4c940a0cda chore: replace all test usage of pin_mut (#2942)
Signed-off-by: tison <wander4096@gmail.com>
2025-04-05 18:44:15 +09:00
tison
1d2089a6f8 chore: replace all doctest usage of pin_mut with pin (#2940)
Signed-off-by: tison <wander4096@gmail.com>
2025-04-05 16:25:39 +09:00
dependabot[bot]
3ce1fca7b4 Update spin requirement from 0.9.8 to 0.10.0
---
updated-dependencies:
- dependency-name: spin
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-02 00:41:42 +09:00
tison
cc3a15d639 chore: remove dependency to pin-utils (#2929)
Signed-off-by: tison <wander4096@gmail.com>
2025-03-23 22:17:51 +09:00
Slixe
3a80c147ae futures ordered: add clear fn (#2927) 2025-02-26 10:39:04 +09:00
Tobias Bengtsson
173c9f8e81 Make assert in select_biased documentation clearer (#2926) 2025-02-26 01:54:56 +09:00
tison
c9b796cc61 chore: recommend to use core lib's ready macro (#2925)
Signed-off-by: tison <wander4096@gmail.com>
2025-02-18 00:50:27 +09:00
Taiki Endo
048995af9e ci: Run clippy on stable 2025-01-25 14:23:33 +09:00
Taiki Endo
5285d05c3e Remove no longer necessary allowed lints 2025-01-25 14:23:33 +09:00
Taiki Endo
087e9ac6cb Enable autolabel in triagebot.toml 2025-01-25 13:59:01 +09:00
Taiki Endo
7f9bbeeffe ci: Test armv7hf Linux on ubuntu-24.04-arm runner
https://github.com/taiki-e/setup-cross-toolchain-action/releases/tag/v1.27.0
2025-01-18 19:37:25 +09:00
Taiki Endo
e2e9217403 ci: Adjust scheduled job 2025-01-18 13:32:17 +09:00
Taiki Endo
39902c4199 ci: Remove workaround for fixed AArch64 Linux runner bug 2025-01-18 13:32:17 +09:00
Taiki Endo
e9337a189c ci: Test AArch64 Linux on ubuntu-24.04-arm runner
https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/
2025-01-18 02:07:49 +09:00
Alison Davis
951d35325c Support shared futures on no_std (#2868) 2025-01-17 04:51:00 +09:00
Taiki Endo
bbaa0e34e4 Use const thread_local 2025-01-13 01:18:27 +09:00
@brodycj - C. Jonathan Brody
b1bfda0ee4 Resolve clippy::unnecessary_map_or warning (#2904) 2025-01-13 00:39:48 +09:00
@brodycj - C. Jonathan Brody
036957bbcd Bump MSRV of utility crates to 1.63 (#2907) 2025-01-13 00:38:27 +09:00
Taiki Endo
7211cb7c5d ci: Work around sanitizer-related regression
```
     Running unittests src/lib.rs (target/debug/deps/futures_macro-cb16371840b70586)

/home/runner/work/futures-rs/futures-rs/target/debug/deps/futures_macro-cb16371840b70586: error while loading shared libraries: libstd-f157c25fb2dbfbe0.so: cannot open shared object file: No such file or directory
error: test failed, to rerun pass `-p futures-macro --lib`

Caused by:
  process didn't exit successfully: `/home/runner/work/futures-rs/futures-rs/target/debug/deps/futures_macro-cb16371840b70586 --skip panic_on_drop_fut` (exit status: 127)
```
2024-10-08 03:18:14 +09:00
Taiki Endo
63f2ba0ea2 Update changelog and clarify about yanking 2024-10-08 03:18:14 +09:00
Taiki Endo
631aa93a59 Sync with 0.3.31 2024-10-05 16:41:20 +09:00
Andrew Lamb
bbfc1ed668 Document how BoxFutures / BoxStreams are often made (#2887) 2024-10-04 10:12:50 +09:00
Imbris
2d4f685b4b Fix use after free of task in FuturesUnordered when dropped future panics (#2886) 2024-10-04 01:11:15 +09:00
Hans Kratz
99ebe58c21 Fix issues with AsyncBufRead::read_line and AsyncBufReadExt::lines (#2884)
Fixes the following issues in `AsyncBufRead::read_line`:
* When the future is dropped the previous string contents are not restored so the string is empty.
* If invalid UTF-8 is encountered the previous string contents are not restored.
* If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails.
* Performance: The whole string to which read contents are appended is check for UTF-8 validity instead of just the added bytes.

Fixes the following issues in `AsyncBufRead::read_line`:
* If an IO error occurs after `read_until_internal` already read a couple of bytes a debug assertion fails. (#2862)

Fixes #2862
2024-09-19 03:58:39 +09:00
AF
b92f4c55a3 Use #[inline(always)] on clone_arc_raw (#2865) 2024-09-15 09:29:58 +09:00
Taiki Endo
0cb6d5a84f Revert "Temporarily disable ref_wake_same test"
This reverts commit 42c2ab0e73.
2024-09-15 09:29:58 +09:00
Bill Fraser
4befac989d Add accessors for the inner of stream::Iter (#2875) 2024-09-14 21:19:45 +09:00
cui fliter
3a8dc66dc9 Add missing symbols (#2883)
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-14 21:19:22 +09:00
Hans Kratz
ebaf1a2866 Various fixes too make the CI green (#2885)
* Fix unexpected `cfg` condition name: ... warnings introduced in Rust 1.80

See https://blog.rust-lang.org/2024/05/06/check-cfg.html

* io_slice_advance feature is now stable

* clippy: enable missing_const_for_thread_local lint, now checks for MSRV (see https://github.com/rust-lang/rust-clippy/issues/12404)

* clippy: fixes for "doc list item without indentation" lint

* clippy: ignore incorrect "first doc comment paragraph is too long" warning

see https://github.com/rust-lang/rust-clippy/issues/13315

* clippy: allow long first paragraphs in select... fn doc comments

* use workspace level setting to ignore error about the futures_sanitizer unexpected config
2024-09-14 21:18:31 +09:00
Taiki Endo
c507ff8337 Tweak imports in tests 2024-05-03 02:22:26 +09:00
Taiki Endo
f9dd281c28 Remove no longer needed extern crate proc_macro 2024-05-03 02:22:26 +09:00