Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.3.29 #2791

Merged
merged 26 commits into from
Oct 26, 2023
Merged

Release 0.3.29 #2791

merged 26 commits into from
Oct 26, 2023

Conversation

taiki-e and others added 26 commits September 7, 2023 02:16
```
error package `log v0.4.19` cannot be built because it requires rustc 1.60.0 or newer, while the currently active rustc version is 1.56.1
```
```
error[E0635]: unknown feature `proc_macro_span_shrink`
  --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.52/src/lib.rs:92:30
   |
92 |     feature(proc_macro_span, proc_macro_span_shrink)
   |                              ^^^^^^^^^^^^^^^^^^^^^^
```
- add `len`, `is_empty` methods to inspect how many messages are
  enqueued in the message queue.
- add test for `len` and `is_empty`

Co-authored-by: Jakub Horak <jakub.horak@ibawizard.net>
and `push_back` instead of `push` (which is deprecated).
…rcuit

These futures should panic if they are polled after completing.
Currently they do so but only if they complete due to exhausting the
`Stream` that they pull data from. If they complete due to
short-circuiting, they are left in a state where `fut` and `accum` are
still `Some`. This means that if they are polled again, they end up
polling the inner `fut` again. That usually causes a panic but the error
message will likely reference the internal `Future`, not `All` / `Any`.

With this commit, `All` and `Any`'s internal state will be set such that
if they are polled again after completing, they will panic without
polling `fut`.
It looks like `All` was originally implemented by copying from `TryFold`
from which it inherited its `accum` field. However, `accum` can only
ever be one of two values: `None` (if `All` has already completed) or
`Some(true)` (if it's still processing values from the inner `Stream`).
It doesn't need to keep track of an accumulator because the very fact
that it hasn't short-circuited yet means that the accumulated value
can't be `Some(false)`. Therefore, we only need two values here and we
can represent them with a `bool` indicating whether or not `All` has
already completed.

The same principle applies for `Any` but substituting `Some(false)` for
`Some(true)`.
```
   error: unused import: `self::stream_select_mod::*`
    --> futures-util/src/async_await/mod.rs:38:9
     |
  38 | pub use self::stream_select_mod::*;
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `-D unused-imports` implied by `-D warnings`
     = help: to override `-D warnings` add `#[allow(unused_imports)]`
```
@taiki-e taiki-e added the futures-0.3 Issue related to the 0.3 versions of futures label Oct 26, 2023
@taiki-e taiki-e merged commit 86f2a6a into 0.3 Oct 26, 2023
24 checks passed
@taiki-e taiki-e deleted the 0.3-next branch October 26, 2023 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
futures-0.3 Issue related to the 0.3 versions of futures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants