diff --git a/.clippy.toml b/.clippy.toml
new file mode 100644
index 0000000000..992016c29a
--- /dev/null
+++ b/.clippy.toml
@@ -0,0 +1 @@
+msrv = "1.36"
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..79a8d7d53f
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,6 @@
+[*.rs]
+end_of_line = lf
+insert_final_newline = true
+charset = utf-8
+indent_style = space
+indent_size = 4
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000000..dfb7eea4ff
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,330 @@
+name: CI
+
+permissions:
+ contents: read
+
+on:
+ pull_request:
+ push:
+ branches:
+ - master
+ - '[0-9]+.[0-9]+'
+ schedule:
+ - cron: '0 1 * * *'
+
+env:
+ CARGO_INCREMENTAL: 0
+ CARGO_NET_RETRY: 10
+ CARGO_TERM_COLOR: always
+ RUST_BACKTRACE: 1
+ RUSTFLAGS: -D warnings
+ RUSTUP_MAX_RETRIES: 10
+
+defaults:
+ run:
+ shell: bash
+
+jobs:
+ test:
+ name: cargo test (${{ matrix.os }})
+ strategy:
+ fail-fast: false
+ matrix:
+ os:
+ - ubuntu-latest
+ - macos-latest
+ - windows-latest
+ runs-on: ${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ # --no-self-update is necessary because the windows environment cannot self-update rustup.exe.
+ run: rustup update nightly --no-self-update && rustup default nightly
+ - run: cargo test --workspace --all-features
+ - run: cargo test --workspace --all-features --release
+
+ cross:
+ name: cross test --target ${{ matrix.target }}
+ strategy:
+ fail-fast: false
+ matrix:
+ target:
+ - i686-unknown-linux-gnu
+ - aarch64-unknown-linux-gnu
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - name: Install cross
+ uses: taiki-e/install-action@cross
+ - run: cross test --target ${{ matrix.target }} --workspace --all-features
+ - run: cross test --target ${{ matrix.target }} --workspace --all-features --release
+ # TODO: https://github.com/rust-lang/futures-rs/issues/2451
+ if: matrix.target != 'aarch64-unknown-linux-gnu'
+
+ core-msrv:
+ name: cargo +${{ matrix.rust }} build (futures-{core, io, sink})
+ strategy:
+ matrix:
+ rust:
+ # This is the minimum Rust version supported by futures-core, futures-io, futures-sink.
+ # When updating this, the reminder to update the minimum required version in README.md, Cargo.toml, and .clippy.toml.
+ - 1.36
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ # cargo does not support for --features/--no-default-features with workspace, so use cargo-hack instead.
+ # Refs: cargo#3620, cargo#4106, cargo#4463, cargo#4753, cargo#5015, cargo#5364, cargo#6195
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+ # remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
+ - run: cargo hack --remove-dev-deps --workspace
+ # Check no-default-features
+ - run: |
+ cargo hack build --workspace --ignore-private --no-default-features \
+ --exclude futures --exclude futures-util --exclude futures-task --exclude futures-macro --exclude futures-executor --exclude futures-channel --exclude futures-test
+ # Check alloc feature
+ - run: |
+ cargo hack build --workspace --ignore-private --no-default-features --features alloc --ignore-unknown-features \
+ --exclude futures --exclude futures-util --exclude futures-task --exclude futures-macro --exclude futures-executor --exclude futures-channel --exclude futures-test
+ # Check std feature
+ - run: |
+ cargo hack build --workspace --ignore-private --no-default-features --features std \
+ --exclude futures --exclude futures-util --exclude futures-task --exclude futures-macro --exclude futures-executor --exclude futures-channel --exclude futures-test
+
+ util-msrv:
+ name: cargo +${{ matrix.rust }} build
+ strategy:
+ matrix:
+ rust:
+ # This is the minimum Rust version supported by futures, futures-util, futures-task, futures-macro, futures-executor, futures-channel, futures-test.
+ # When updating this, the reminder to update the minimum required version in README.md and Cargo.toml.
+ - 1.45
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+ # remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
+ - run: cargo hack --remove-dev-deps --workspace
+ # Check default features
+ - run: cargo hack build --workspace --ignore-private
+ # Check no-default-features
+ - run: cargo hack build --workspace --exclude futures-test --ignore-private --no-default-features
+ # Check alloc feature
+ - run: cargo hack build --workspace --exclude futures-test --ignore-private --no-default-features --features alloc --ignore-unknown-features
+ # Check std feature
+ - run: cargo hack build --workspace --ignore-private --no-default-features --features std --ignore-unknown-features
+ # Check compat feature (futures, futures-util)
+ - run: cargo hack build -p futures -p futures-util --no-default-features --features std,io-compat
+ # Check thread-pool feature (futures, futures-executor)
+ - run: cargo hack build -p futures -p futures-executor --no-default-features --features std,thread-pool
+
+ build:
+ name: cargo +${{ matrix.rust }} build
+ strategy:
+ fail-fast: false
+ matrix:
+ rust:
+ - stable
+ - beta
+ - nightly
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+ - run: cargo hack build --workspace --no-dev-deps
+ - run: cargo build --tests --features default,thread-pool,io-compat --manifest-path futures/Cargo.toml
+
+ minimal-versions:
+ name: cargo build -Z minimal-versions
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+ # remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
+ - run: cargo hack --remove-dev-deps --workspace
+ - run: cargo update -Z minimal-versions
+ - run: cargo build --workspace --all-features
+
+ no-std:
+ name: cargo build --target ${{ matrix.target }}
+ strategy:
+ fail-fast: false
+ matrix:
+ # thumbv7m-none-eabi supports atomic CAS.
+ # thumbv6m-none-eabi supports atomic, but not atomic CAS.
+ target:
+ - thumbv7m-none-eabi
+ - thumbv6m-none-eabi
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - run: rustup target add ${{ matrix.target }}
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+ # remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
+ - run: cargo hack --remove-dev-deps --workspace
+ - run: |
+ cargo hack build --manifest-path futures/tests/no-std/Cargo.toml \
+ --each-feature --optional-deps \
+ --target ${{ matrix.target }}
+ - run: |
+ cargo hack build --workspace --ignore-private \
+ --exclude futures-test --exclude futures-macro \
+ --no-default-features \
+ --target ${{ matrix.target }}
+ - run: |
+ cargo hack build --workspace --ignore-private \
+ --exclude futures-test --exclude futures-macro \
+ --no-default-features --features alloc --ignore-unknown-features \
+ --target ${{ matrix.target }}
+ - run: |
+ cargo hack build --workspace --ignore-private \
+ --exclude futures-test --exclude futures-macro \
+ --no-default-features --features async-await,alloc --ignore-unknown-features \
+ --target ${{ matrix.target }}
+
+ bench:
+ name: cargo bench
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - run: cargo bench --workspace
+ - run: cargo bench --manifest-path futures-util/Cargo.toml --features=bilock,unstable
+
+ features:
+ name: cargo hack check --feature-powerset
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - name: Install cargo-hack
+ uses: taiki-e/install-action@cargo-hack
+ # Check each specified feature works properly
+ # * `--feature-powerset` - run for the feature powerset of the package
+ # * `--depth 2` - limit the max number of simultaneous feature flags of `--feature-powerset`
+ # * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
+ # * `--exclude futures-test` - futures-test cannot be compiled with no-default features
+ # * `--features unstable` - some features cannot be compiled without this feature
+ # * `--ignore-unknown-features` - some crates doesn't have 'unstable' feature
+ - run: |
+ cargo hack check \
+ --feature-powerset --depth 2 --no-dev-deps \
+ --workspace --exclude futures-test \
+ --features unstable --ignore-unknown-features
+
+ # When this job failed, run ci/no_atomic_cas.sh and commit result changes.
+ codegen:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ pull-requests: write
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - run: ci/no_atomic_cas.sh
+ - run: git add -N . && git diff --exit-code
+ if: github.repository_owner != 'rust-lang' || github.event_name != 'schedule'
+ - id: diff
+ run: |
+ git config user.name "Taiki Endo"
+ git config user.email "te316e89@gmail.com"
+ git add -N .
+ if ! git diff --exit-code; then
+ git add .
+ git commit -m "Update no_atomic_cas.rs"
+ echo "::set-output name=success::false"
+ fi
+ if: github.repository_owner == 'rust-lang' && github.event_name == 'schedule'
+ - uses: peter-evans/create-pull-request@v3
+ with:
+ title: Update no_atomic_cas.rs
+ body: |
+ Auto-generated by [create-pull-request][1]
+ [Please close and immediately reopen this pull request to run CI.][2]
+
+ [1]: https://github.com/peter-evans/create-pull-request
+ [2]: https://github.com/peter-evans/create-pull-request/blob/HEAD/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs
+ branch: update-no-atomic-cas-rs
+ if: github.repository_owner == 'rust-lang' && github.event_name == 'schedule' && steps.diff.outputs.success == 'false'
+
+ miri:
+ name: cargo miri test
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup toolchain install nightly --component miri && rustup default nightly
+ # futures-executor uses boxed futures so many tests trigger https://github.com/rust-lang/miri/issues/1038
+ - run: cargo miri test --workspace --exclude futures-executor --all-features
+ env:
+ MIRIFLAGS: -Zmiri-check-number-validity -Zmiri-symbolic-alignment-check -Zmiri-tag-raw-pointers -Zmiri-disable-isolation
+
+ san:
+ name: cargo test -Z sanitizer=${{ matrix.sanitizer }}
+ strategy:
+ fail-fast: false
+ matrix:
+ sanitizer:
+ - address
+ - memory
+ - thread
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - run: rustup component add rust-src
+ - run: cargo -Z build-std test --workspace --all-features --target x86_64-unknown-linux-gnu --lib --tests
+ env:
+ # TODO: Once `cfg(sanitize = "..")` is stable, replace
+ # `cfg(futures_sanitizer)` with `cfg(sanitize = "..")` and remove
+ # `--cfg futures_sanitizer`.
+ RUSTFLAGS: -D warnings -Z sanitizer=${{ matrix.sanitizer }} --cfg futures_sanitizer
+
+ # This branch no longer actively developed. Most commits to this
+ # branch are backporting and should not be blocked by clippy.
+ # clippy:
+ # name: cargo clippy
+ # runs-on: ubuntu-latest
+ # steps:
+ # - uses: actions/checkout@v2
+ # - name: Install Rust
+ # run: rustup toolchain install nightly --component clippy && rustup default nightly
+ # - run: cargo clippy --workspace --all-features --all-targets
+
+ fmt:
+ name: cargo fmt
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update stable
+ - run: cargo fmt --all -- --check
+
+ docs:
+ name: cargo doc
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update nightly && rustup default nightly
+ - run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc --workspace --no-deps --all-features
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000000..dc9b65bf6e
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,26 @@
+name: Release
+
+on:
+ push:
+ tags:
+ - '[0-9]+.*'
+
+env:
+ RUSTFLAGS: -D warnings
+ RUST_BACKTRACE: 1
+
+jobs:
+ create-release:
+ if: github.repository_owner == 'rust-lang'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update stable
+ - run: cargo build --all
+ - uses: taiki-e/create-gh-release-action@v1
+ with:
+ changelog: CHANGELOG.md
+ branch: 'master|[0-9]+\.[0-9]+'
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.rustfmt.toml b/.rustfmt.toml
new file mode 100644
index 0000000000..2a79d9274a
--- /dev/null
+++ b/.rustfmt.toml
@@ -0,0 +1,2 @@
+use_small_heuristics = "Max"
+edition = "2018"
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 93526353b8..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,159 +0,0 @@
-language: rust
-sudo: false
-
-# Refs: https://levans.fr/rust_travis_cache.html
-cache:
- directories:
- - /home/travis/.cargo
-before_cache:
- - rm -rf /home/travis/.cargo/registry
-
-matrix:
- include:
- # This is the minimum Rust version supported by futures-rs.
- # When updating this, the reminder to update the minimum required version in README.md.
- - name: cargo check (minimum required version)
- rust: 1.36.0
- install:
- # cargo does not support for --features/--no-default-features with workspace, so use cargo-hack instead.
- # Refs: cargo#3620, cargo#4106, cargo#4463, cargo#4753, cargo#5015, cargo#5364, cargo#6195
- - if ! cargo hack -V 2>/dev/null; then
- cargo install cargo-hack;
- fi
- script:
- # remove dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- - cargo hack --remove-dev-deps --workspace
- # Check no-default-features
- - cargo hack check --workspace --exclude futures-test --ignore-private --no-default-features
- # Check alloc feature
- - cargo hack check --workspace --exclude futures-test --ignore-private --no-default-features --features alloc --ignore-unknown-features
- # Check std feature
- - cargo hack check --workspace --ignore-private --no-default-features --features std --ignore-unknown-features
- # Check compat feature (futures, futures-util)
- - cargo hack check -p futures -p futures-util --no-default-features --features std,io-compat
- # Check thread-pool feature (futures, futures-executor)
- - cargo hack check -p futures -p futures-executor --no-default-features --features std,thread-pool
-
- # This is the minimum Rust version supported by `async-await` feature.
- # When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
- - name: cargo build --features async-await (minimum required version)
- rust: 1.39.0
- script:
- - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- # async-await feature is activated by default.
- - cargo build --workspace
-
- - name: cargo +stable build
- rust: stable
- script:
- - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- - cargo build --workspace
-
- - name: cargo +beta build
- rust: beta
- script:
- - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- - cargo build --workspace
-
- - name: cargo test
- rust: nightly
- os: osx
-
- - name: cargo test
- rust: nightly
- os: linux
-
- - name: cargo build (with minimal versions)
- rust: nightly
- script:
- - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- - cargo update -Zminimal-versions
- - cargo build --workspace --all-features
-
- - name: cargo clippy
- rust: nightly
- install:
- - if ! rustup component add clippy 2>/dev/null; then
- target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy`;
- echo "'clippy' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead";
- rustup toolchain install nightly-$target;
- rustup default nightly-$target;
- rustup component add clippy;
- fi
- script:
- - cargo clippy --workspace --all-features --all-targets
-
- - name: cargo bench
- rust: nightly
- script:
- - cargo bench --workspace
- - cargo bench --manifest-path futures-util/Cargo.toml --features=bilock,unstable
-
- - name: cargo build --target=thumbv6m-none-eabi
- rust: nightly
- install:
- - rustup target add thumbv6m-none-eabi
- script:
- - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- - cargo build --manifest-path futures/Cargo.toml
- --target thumbv6m-none-eabi
- --no-default-features
- --features unstable,cfg-target-has-atomic
- - cargo build --manifest-path futures/Cargo.toml
- --target thumbv6m-none-eabi
- --no-default-features
- --features unstable,cfg-target-has-atomic,alloc
- - cargo build --manifest-path futures/Cargo.toml
- --target thumbv6m-none-eabi
- --no-default-features
- --features unstable,cfg-target-has-atomic,async-await
-
- - name: cargo build --target=thumbv7m-none-eabi
- rust: nightly
- install:
- - rustup target add thumbv7m-none-eabi
- script:
- - cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- - cargo build --manifest-path futures/Cargo.toml
- --target thumbv7m-none-eabi
- --no-default-features
- - cargo build --manifest-path futures/Cargo.toml
- --target thumbv7m-none-eabi
- --no-default-features
- --features alloc
- - cargo build --manifest-path futures/Cargo.toml
- --target thumbv7m-none-eabi
- --no-default-features
- --features async-await
-
- - name: cargo check (features)
- rust: nightly
- install:
- - cargo install cargo-hack
- script:
- # Check each specified feature works properly
- # * `--each-feature` - run for each feature which includes --no-default-features and default features of package
- # * `--no-dev-deps` - build without dev-dependencies to avoid https://github.com/rust-lang/cargo/issues/4866
- # * `--exclude futures-test` - futures-test cannot be compiled with no-default features
- # * `--features unstable` - some features cannot be compiled without this feature
- # * `--ignore-unknown-features` - some crates doesn't have 'unstable' feature
- - cargo hack check
- --each-feature --no-dev-deps
- --workspace --exclude futures-test
- --features unstable --ignore-unknown-features
-
- - name: cargo doc
- rust: nightly
- script:
- - RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-deps --all-features
-
-script:
- - cargo test --workspace --all-features
- - cargo test --workspace --all-features --release
-
-env:
- - RUSTFLAGS=-Dwarnings
-
-notifications:
- email:
- on_success: never
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b93b0ae557..8f76048681 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,176 @@
+# 0.3.21 - 2022-02-06
+
+* Fix potential data race in `FlattenUnordered` that introduced in 0.3.20 (#2566)
+
+# 0.3.20 - 2022-02-06
+
+NOTE: This release has been yanked due to a bug fixed in 0.3.21.
+
+* Fix stacked borrows violations when `-Zmiri-tag-raw-pointers` is enabled. This raises MSRV of `futures-task` to 1.45. (#2548, #2550)
+* Change `FuturesUnordered` to respect yielding from future (#2551)
+* Add `StreamExt::{flatten_unordered, flat_map_unordered}` (#2083)
+
+# 0.3.19 - 2021-12-18
+
+* Remove unstable `read-initializer` feature (#2534)
+* Fix panic in `FuturesUnordered` (#2535)
+* Fix compatibility issue with `FuturesUnordered` and tokio's cooperative scheduling (#2527)
+* Add `StreamExt::count` (#2495)
+
+# 0.3.18 - 2021-11-23
+
+NOTE: This release has been yanked. See #2529 for details.
+
+* Fix unusable `Sink` implementation on `stream::Scan` (#2499)
+* Make `task::noop_waker_ref` available without `std` feature (#2505)
+* Add async `LineWriter` (#2477)
+* Remove dependency on `proc-macro-hack`. This raises MSRV of utility crates to 1.45. (#2520)
+
+# 0.3.17 - 2021-08-30
+
+* Use `FuturesOrdered` in `join_all` (#2412)
+* Add `{future, stream}::poll_immediate` (#2452)
+* Add `stream_select!` macro (#2262)
+* Implement `Default` for `OptionFuture` (#2471)
+* Add `Peekable::{peek_mut, poll_peek_mut}` (#2488)
+* Add `BufReader::seek_relative` (#2489)
+
+# 0.3.16 - 2021-07-23
+
+* Add `TryStreamExt::try_chunks` (#2438)
+* Add `StreamExt::{all, any}` (#2460)
+* Add `stream::select_with_strategy` (#2450)
+* Update to new `io_slice_advance` interface (#2454)
+
+# 0.3.15 - 2021-05-11
+
+* Use `#[proc_macro]` at Rust 1.45+ to fix an issue where proc macros don't work with rust-analyzer (#2407)
+* Support targets that do not have atomic CAS on stable Rust (#2400)
+* futures-test: Add async `#[test]` function attribute (#2409)
+* Add `stream::abortable` (#2410)
+* Add `FuturesUnordered::clear` (#2415)
+* Implement `IntoIterator` for `FuturesUnordered` (#2423)
+* Implement `Send` and `Sync` for `FuturesUnordered` iterators (#2416)
+* Make `FuturesUnordered::iter_pin_ref` public (#2423)
+* Add `SelectAll::clear` (#2430)
+* Add `SelectAll::{iter, iter_mut}` (#2428)
+* Implement `IntoIterator` for `SelectAll` (#2428)
+* Implement `Clone` for `WeakShared` (#2396)
+
+# 0.3.14 - 2021-04-10
+
+* Add `future::SelectAll::into_inner` (#2363)
+* Allow calling `UnboundedReceiver::try_next` after `None` (#2369)
+* Reexport non-Ext traits from the root of `futures_util` (#2377)
+* Add `AsyncSeekExt::stream_position` (#2380)
+* Add `stream::Peekable::{next_if, next_if_eq}` (#2379)
+
+# 0.3.13 - 2021-02-23
+
+* Mitigated starvation issues in `FuturesUnordered` (#2333)
+* Fixed race with dropping `mpsc::Receiver` (#2304)
+* Added `Shared::{strong_count, weak_count}` (#2346)
+* Added `no_std` support for `task::noop_waker_ref` (#2332)
+* Implemented `Stream::size_hint` for `Either` (#2325)
+
+# 0.3.12 - 2021-01-15
+
+* Fixed `Unpin` impl of `future::{MaybeDone, TryMaybeDone}` where trait bounds were accidentally added in 0.3.9. (#2317)
+
+# 0.3.11 - 2021-01-14
+
+* Fixed heap buffer overflow in `AsyncReadExt::{read_to_end, read_to_string}` (#2314)
+
+# 0.3.10 - 2021-01-13
+
+NOTE: This release has been yanked. See #2310 for details.
+
+* Fixed type-inference in `sink::unfold` by specifying more of its types (breaking change -- see #2311)
+
+# 0.3.9 - 2021-01-08
+
+NOTE: This release has been yanked. See #2310 for details.
+
+* Significantly improved compile time when `async-await` crate feature is disabled (#2273)
+* Added `stream::repeat_with` (#2279)
+* Added `StreamExt::unzip` (#2263)
+* Added `sink::unfold` (#2268)
+* Added `SinkExt::feed` (#2155)
+* Implemented `FusedFuture` for `oneshot::Receiver` (#2300)
+* Implemented `Clone` for `sink::With` (#2290)
+* Re-exported `MapOkOrElse`, `MapInto`, `OkInto`, `TryFlatten`, `WriteAllVectored` (#2275)
+
+# 0.3.8 - 2020-11-04
+
+NOTE: This release has been yanked. See #2310 for details.
+
+* Switched proc-macros to use native `#[proc_macro]` at Rust 1.45+ (#2243)
+* Added `WeakShared` (#2169)
+* Added `TryStreamExt::try_buffered` (#2245)
+* Added `StreamExt::cycle` (#2252)
+* Implemented `Clone` for `stream::{Empty, Pending, Repeat, Iter}` (#2248, #2252)
+* Fixed panic in some `TryStreamExt` combinators (#2250)
+
+# 0.3.7 - 2020-10-23
+
+NOTE: This release has been yanked. See #2310 for details.
+
+* Fixed unsoundness in `MappedMutexGuard` (#2240)
+* Re-exported `TakeUntil` (#2235)
+* futures-test: Prevent double panic in `panic_waker` (#2236)
+
+# 0.3.6 - 2020-10-06
+
+NOTE: This release has been yanked. See #2310 for details.
+
+* Fixed UB due to missing 'static on `task::waker` (#2206)
+* Added `AsyncBufReadExt::fill_buf` (#2225)
+* Added `TryStreamExt::try_take_while` (#2212)
+* Added `is_connected_to` method to `mpsc::{Sender, UnboundedSender}` (#2179)
+* Added `is_connected_to` method to `oneshot::Sender` (#2158)
+* Implement `FusedStream` for `FuturesOrdered` (#2205)
+* Fixed documentation links
+* Improved documentation
+* futures-test: Added `track_closed` method to `AsyncWriteTestExt` and `SinkTestExt` (#2159)
+* futures-test: Implemented more traits for `InterleavePending` (#2208)
+* futures-test: Implemented more traits for `AssertUnmoved` (#2208)
+
+# 0.3.5 - 2020-05-08
+
+NOTE: This release has been yanked. See #2310 for details.
+
+* Added `StreamExt::flat_map`.
+* Added `StreamExt::ready_chunks`.
+* Added `*_unpin` methods to `SinkExt`.
+* Added a `cancellation()` future to `oneshot::Sender`.
+* Added `reunite` method to `ReadHalf` and `WriteHalf`.
+* Added `Extend` implementations for `Futures(Un)Ordered` and `SelectAll`.
+* Added support for reexporting the `join!` and `select!` macros.
+* Added `no_std` support for the `pending!` and `poll!` macros.
+* Added `Send` and `Sync` support for `AssertUnmoved`.
+* Fixed a bug where `Shared` wasn't relinquishing control to the executor.
+* Removed the `Send` bound on the output of `RemoteHandle`.
+* Relaxed bounds on `FuturesUnordered`.
+* Reorganized internal tests to work under different `--feature`s.
+* Reorganized the bounds on `StreamExt::forward`.
+* Removed and replaced a large amount of internal `unsafe`.
+
# 0.3.4 - 2020-02-06
+
+NOTE: This release has been yanked. See #2310 for details.
+
* Fixed missing `Drop` for `UnboundedReceiver` (#2064)
# 0.3.3 - 2020-02-04
+
+NOTE: This release has been yanked. See #2310 for details.
+
* Fixed compatibility issue with pinned facade (#2062)
# 0.3.2 - 2020-02-03
+
+NOTE: This release has been yanked. See #2310 for details.
+
* Improved buffering performance of `SplitSink` (#1969)
* Added `select_biased!` macro (#1976)
* Added `hash_receiver` method to mpsc channel (#1962)
@@ -12,7 +178,7 @@
* Fixed bug with zero-size buffers in vectored IO (#1998)
* `AtomicWaker::new()` is now `const fn` (#2007)
* Fixed bug between threadpool and user park/unparking (#2010)
-* Added `stream::Peakable::peek` (#2021)
+* Added `stream::Peekable::peek` (#2021)
* Added `StreamExt::scan` (#2044)
* Added impl of `AsyncRead`/`Write` for `BufReader`/`Writer` (#2033)
* Added impl of `Spawn` and `LocalSpawn` for `Arc` (#2039)
@@ -22,10 +188,16 @@
* Mitigated starvation issues in `FuturesUnordered` (#2049)
* Added `TryFutureExt::map_ok_or_else` (#2058)
-# 0.3.1 - 2019-11-7
+# 0.3.1 - 2019-11-07
+
+NOTE: This release has been yanked. See #2310 for details.
+
* Fix signature of `LocalSpawn` trait (breaking change -- see #1959)
-# 0.3.0 - 2019-11-5
+# 0.3.0 - 2019-11-05
+
+NOTE: This release has been yanked. See #2310 for details.
+
* Stable release along with stable async/await!
* Added async/await to default features (#1953)
* Changed `Spawn` trait and `FuturesUnordered::push` to take `&self` (#1950)
@@ -46,7 +218,8 @@
* Added some missing `Clone` implementations
* Documentation fixes
-# 0.3.0-alpha.19 - 2019-9-25
+# 0.3.0-alpha.19 - 2019-09-25
+
* Stabilized the `async-await` feature (#1816)
* Made `async-await` feature no longer require `std` feature (#1815)
* Updated `proc-macro2`, `syn`, and `quote` to 1.0 (#1798)
@@ -69,7 +242,8 @@
* Removed dependency on `rand` by using our own PRNG (#1837)
* Removed `futures-core` dependency from `futures-sink` (#1832)
-# 0.3.0-alpha.18 - 2019-8-9
+# 0.3.0-alpha.18 - 2019-08-09
+
* Rewrote `join!` and `try_join!` as procedural macros to allow passing expressions (#1783)
* Banned manual implementation of `TryFuture` and `TryStream` for forward compatibility. See #1776 for more details. (#1777)
* Changed `AsyncReadExt::read_to_end` to return the total number of bytes read (#1721)
@@ -88,7 +262,8 @@
* Added `TryStreamExt::try_flatten` (#1731)
* Added `FutureExt::now_or_never` (#1747)
-# 0.3.0-alpha.17 - 2019-7-3
+# 0.3.0-alpha.17 - 2019-07-03
+
* Removed `try_ready!` macro in favor of `ready!(..)?`. (#1602)
* Removed `io::Window::{set_start, set_end}` in favor of `io::Window::set`. (#1667)
* Re-exported `pin_utils::pin_mut!` macro. (#1686)
@@ -121,7 +296,8 @@
* Renamed `Sink::SinkError` to `Sink::Error`.
* Made a number of dependencies of `futures-util` optional.
-# 0.3.0-alpha.16 - 2019-5-10
+# 0.3.0-alpha.16 - 2019-05-10
+
* Updated to new nightly `async_await`.
* Changed `AsyncRead::poll_vectored_read` and `AsyncWrite::poll_vectored_write` to use
stabilized `std::io::{IoSlice, IoSliceMut}` instead of `iovec::IoVec`, and renamed to
@@ -132,7 +308,8 @@
* Added `AsyncBufReadExt::{read_line, lines}`.
* Added `io::BufReader`.
-# 0.3.0-alpha.15 - 2019-4-26
+# 0.3.0-alpha.15 - 2019-04-26
+
* Updated to stabilized `futures_api`.
* Removed `StreamObj`, cautioned against usage of `FutureObj`.
* Changed `StreamExt::select` to a function.
@@ -145,10 +322,11 @@
* Added functions to partially progress a local pool.
* Changed to use our own `Either` type rather than the one from the `either` crate.
-# 0.3.0-alpha.14 - 2019-4-15
+# 0.3.0-alpha.14 - 2019-04-15
+
* Updated to new nightly `futures_api`.
* Changed `Forward` combinator to drop sink after completion, and allow `!Unpin` `Sink`s.
-* Added 0.1 <-> 0.3 compatability shim for `Sink`s.
+* Added 0.1 <-> 0.3 compatibility shim for `Sink`s.
* Changed `Sink::Item` to a generic parameter `Sink- `, allowing `Sink`s to accept
multiple different types, including types containing references.
* Changed `AsyncRead` and `AsyncWrite` to take `Pin<&mut Self>` rather than `&mut self`.
@@ -156,7 +334,8 @@
* Changed `join` and `try_join` combinators to functions.
* Fixed propagation of `cfg-target-has-atomic` feature.
-# 0.3.0-alpha.13 - 2019-2-20
+# 0.3.0-alpha.13 - 2019-02-20
+
* Updated to new nightly with stabilization candidate API.
* Removed `LocalWaker`.
* Added `#[must_use]` to `Stream` and `Sink` traits.
@@ -166,7 +345,8 @@
* Removed `TokioDefaultSpawner` and `tokio-compat`.
* Moved intra-crate dependencies to exact versions.
-# 0.3.0-alpha.12 - 2019-1-14
+# 0.3.0-alpha.12 - 2019-01-14
+
* Updated to new nightly with a modification to `Pin::set`.
* Expose `AssertUnmoved` and `PendingOnce`.
* Prevent double-panic in `AssertUnmoved`.
@@ -174,6 +354,7 @@
* Implement `Default` for `Mutex` and `SelectAll`.
# 0.3.0-alpha.11 - 2018-12-27
+
* Updated to newly stabilized versions of the `pin` and `arbitrary_self_types` features.
* Re-added `select_all` for streams.
* Added `TryStream::into_async_read` for converting from a stream of bytes into
@@ -183,6 +364,7 @@
* Exposed `join_all` from the facade
# 0.3.0-alpha.10 - 2018-11-27
+
* Revamped `select!` macro
* Added `select_next_some` method for getting only the `Some` elements of a stream from `select!`
* Added `futures::lock::Mutex` for async-aware synchronization.
@@ -195,27 +377,33 @@
* Added `try_concat`
# 0.3.0-alpha.9 - 2018-10-18
+
* Fixed in response to new nightly handling of 2018 edition + `#![no_std]`
# 0.3.0-alpha.8 - 2018-10-16
+
* Fixed stack overflow in 0.1 compatibility layer
* Added AsyncRead / AsyncWrite compatibility layer
* Added Spawn -> 0.1 Executor compatibility
* Made 0.1 futures usable on 0.3 executors without an additional global `Task`, accomplished by wrapping 0.1 futures in an 0.1 `Spawn` when using them as 0.3 futures.
-* Cleanups and improvments to the `AtomicWaker` implementation.
+* Cleanups and improvements to the `AtomicWaker` implementation.
# 0.3.0-alpha.7 - 2018-10-01
+
* Update to new nightly which removes `Spawn` from `task::Context` and replaces `Context` with `LocalWaker`.
* Add `Spawn` and `LocalSpawn` traits and `FutureObj` and `LocalFutureObj` types to `futures-core`.
# 0.3.0-alpha.6 - 2018-09-10
+
* Replace usage of `crate` visibility with `pub(crate)` now that `crate` visibility is no longer included in the 2018 edition
* Remove newly-stabilized "edition" feature in Cargo.toml files
# 0.3.0-alpha.5 - 2018-09-03
+
* Revert usage of cargo crate renaming feature
# 0.3.0-alpha.4 - 2018-09-02
+
**Note: This release does not work, use `0.3.0-alpha.5` instead**
* `future::ok` and `future:err` to create result wrapping futures (similar to `future::ready`)
@@ -223,13 +411,14 @@
* `StreamExt::boxed` combinator
* Unsoundness fix for `FuturesUnordered`
* `StreamObj` (similar to `FutureObj`)
-* Code examples for compatiblity layer functions
-* Use cargo create renaming feature to import `futures@0.1` for compatiblily layer
+* Code examples for compatibility layer functions
+* Use cargo create renaming feature to import `futures@0.1` for compatibility layer
* Import pinning APIs from `core::pin`
* Run Clippy in CI only when it is available
# 0.3.0-alpha.3 - 2018-08-15
-* Compatibilty with newest nightly
+
+* Compatibility with newest nightly
* Futures 0.1 compatibility layer including Tokio compatibility
* Added `spawn!` and `spawn_with_handle!` macros
* Added `SpawnExt` methods `spawn` and `spawn_with_handle`
@@ -239,7 +428,7 @@
* Improvements to `select!` and `join!` macros
* Added `try_join!` macro
* Added `StreamExt` combinator methods `try_join` and `for_each_concurrent`
-* Added `TryStreamExt` combinator methdos `into_stream`, `try_filter_map`, `try_skip_while`, `try_for_each_concurrent` and `try_buffer_unordered`
+* Added `TryStreamExt` combinator methods `into_stream`, `try_filter_map`, `try_skip_while`, `try_for_each_concurrent` and `try_buffer_unordered`
* Fix stream termination bug in `StreamExt::buffered` and `StreamExt::buffer_unordered`
* Added docs for `StreamExt::buffered`, `StreamExt::buffer_unordered`
* Added `task::local_waker_ref_from_nonlocal` and `task::local_waker_ref` functions
@@ -247,16 +436,17 @@
* Doc improvements to `StreamExt::select`
# 0.3.0-alpha.2 - 2018-07-30
+
* The changelog is back!
-* Compatiblity with futures API in latest nightly
+* Compatibility with futures API in latest nightly
* Code examples and doc improvements
- - IO: Methods of traits `AsyncReadExt`, `AsyncWriteExt`
- - Future:
- - Methods of trait `TryFutureExt`
- - Free functions `empty`, `lazy`, `maybe_done`, `poll_fn` and `ready`
- - Type `FutureOption`
- - Macros `join!`, `select!` and `pending!`
- - Stream: Methods of trait `TryStreamExt`
+ * IO: Methods of traits `AsyncReadExt`, `AsyncWriteExt`
+ * Future:
+ * Methods of trait `TryFutureExt`
+ * Free functions `empty`, `lazy`, `maybe_done`, `poll_fn` and `ready`
+ * Type `FutureOption`
+ * Macros `join!`, `select!` and `pending!`
+ * Stream: Methods of trait `TryStreamExt`
* Added `TryStreamExt` combinators `map_ok`, `map_err`, `err_into`, `try_next` and `try_for_each`
* Added `Drain`, a sink that will discard all items given to it. Can be created using the `drain` function
* Bugfix for the `write_all` combinator
@@ -270,10 +460,11 @@
* We now use the unstable `use_extern_macros` feature for macro reexports
* CI improvements: Named CI jobs, tests are now run on macOS and Linux, the docs are generated and Clippy needs to pass
* `#[deny(warnings)]` was removed from all crates and is now only enforced in the CI
-* We now have a naming convention for type paramters: `Fut` future, `F` function, `St` stream, `Si` sink, `S` sink & stream, `R` reader, `W` writer, `T` value, `E` error
+* We now have a naming convention for type parameters: `Fut` future, `F` function, `St` stream, `Si` sink, `S` sink & stream, `R` reader, `W` writer, `T` value, `E` error
* "Task" is now defined as our term for "lightweight thread". The code of the executors and `FuturesUnordered` was refactored to align with this definition.
# 0.3.0-alpha.1 - 2018-07-19
+
* Major changes: See [the announcement](https://rust-lang-nursery.github.io/futures-rs/blog/2018/07/19/futures-0.3.0-alpha.1.html) on our new blog for details. The changes are too numerous to be covered in this changelog because nearly every line of code was modified.
# 0.1.17 - 2017-10-31
diff --git a/Cargo.toml b/Cargo.toml
index 56d24c2e90..d27a9f2885 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,6 +11,10 @@ members = [
"futures-util",
"futures-test",
+ "futures/tests/macro-tests",
+ "futures/tests/macro-reexport",
+ "futures/tests/no-std",
+
"examples/functional",
"examples/imperative",
]
diff --git a/README.md b/README.md
index 5c1bdcbc98..e6127fd6f8 100644
--- a/README.md
+++ b/README.md
@@ -7,17 +7,13 @@
-
-
+
+
-
-
-
-
@@ -42,13 +38,7 @@ Add this to your `Cargo.toml`:
futures = "0.3"
```
-Now, you can use futures-rs:
-
-```rust
-use futures::future::Future;
-```
-
-The current futures-rs requires Rust 1.39 or later.
+The current `futures` requires Rust 1.45 or later.
### Feature `std`
@@ -58,22 +48,14 @@ a `#[no_std]` environment, use:
```toml
[dependencies]
-futures = { version = "0.3.4", default-features = false }
+futures = { version = "0.3", default-features = false }
```
-# License
-
-This project is licensed under either of
-
- * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
- http://www.apache.org/licenses/LICENSE-2.0)
- * MIT license ([LICENSE-MIT](LICENSE-MIT) or
- http://opensource.org/licenses/MIT)
-
-at your option.
+## License
-### Contribution
+Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
+[MIT license](LICENSE-MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
-for inclusion in futures-rs by you, as defined in the Apache-2.0 license, shall be
-dual licensed as above, without any additional terms or conditions.
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
diff --git a/ci/no_atomic_cas.sh b/ci/no_atomic_cas.sh
new file mode 100755
index 0000000000..ba0200d698
--- /dev/null
+++ b/ci/no_atomic_cas.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+set -euo pipefail
+IFS=$'\n\t'
+cd "$(dirname "$0")"/..
+
+# Update the list of targets that do not support atomic CAS operations.
+#
+# Usage:
+# ./ci/no_atomic_cas.sh
+
+file="no_atomic_cas.rs"
+
+no_atomic_cas=()
+for target in $(rustc --print target-list); do
+ target_spec=$(rustc --print target-spec-json -Z unstable-options --target "${target}")
+ res=$(jq <<<"${target_spec}" -r 'select(."atomic-cas" == false)')
+ [[ -z "${res}" ]] || no_atomic_cas+=("${target}")
+done
+
+cat >"${file}" <>"${file}"
+done
+cat >>"${file}" <"]
-edition = "2018"
-publish = false
-
-[workspace]
-
-[dependencies]
-toml_edit = "0.1.3"
diff --git a/ci/remove-dev-dependencies/src/main.rs b/ci/remove-dev-dependencies/src/main.rs
deleted file mode 100644
index 0b5b0452fe..0000000000
--- a/ci/remove-dev-dependencies/src/main.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-use std::{env, error::Error, fs};
-
-fn main() -> Result<(), Box> {
- for file in env::args().skip(1) {
- let content = fs::read_to_string(&file)?;
- let mut doc: toml_edit::Document = content.parse()?;
- doc.as_table_mut().remove("dev-dependencies");
- fs::write(file, doc.to_string())?;
- }
-
- Ok(())
-}
diff --git a/examples/functional/Cargo.toml b/examples/functional/Cargo.toml
index 468a45432d..7b8b494d98 100644
--- a/examples/functional/Cargo.toml
+++ b/examples/functional/Cargo.toml
@@ -1,20 +1,8 @@
[package]
name = "futures-example-functional"
edition = "2018"
-version = "0.3.0"
-authors = ["Alex Crichton "]
-license = "MIT OR Apache-2.0"
-readme = "../README.md"
-keywords = ["futures", "async", "future"]
-repository = "https://github.com/rust-lang/futures-rs"
-homepage = "https://rust-lang.github.io/futures-rs"
-documentation = "https://docs.rs/futures/0.3.0"
-description = """
-An implementation of futures and streams featuring zero allocations,
-composability, and iterator-like interfaces.
-"""
-categories = ["asynchronous"]
+version = "0.1.0"
publish = false
[dependencies]
-futures = { path = "../../futures", version = "0.3.0", features = ["thread-pool"] }
+futures = { path = "../../futures", features = ["thread-pool"] }
diff --git a/examples/functional/src/main.rs b/examples/functional/src/main.rs
index 3ce65de66a..2ed8b37c58 100644
--- a/examples/functional/src/main.rs
+++ b/examples/functional/src/main.rs
@@ -30,9 +30,7 @@ fn main() {
// responsible for transmission
pool.spawn_ok(fut_tx_result);
- let fut_values = rx
- .map(|v| v * 2)
- .collect();
+ let fut_values = rx.map(|v| v * 2).collect();
// Use the executor provided to this async block to wait for the
// future to complete.
@@ -40,9 +38,9 @@ fn main() {
};
// Actually execute the above future, which will invoke Future::poll and
- // subsequenty chain appropriate Future::poll and methods needing executors
+ // subsequently chain appropriate Future::poll and methods needing executors
// to drive all futures. Eventually fut_values will be driven to completion.
let values: Vec = executor::block_on(fut_values);
println!("Values={:?}", values);
-}
\ No newline at end of file
+}
diff --git a/examples/imperative/Cargo.toml b/examples/imperative/Cargo.toml
index b5d47c0076..3405451f00 100644
--- a/examples/imperative/Cargo.toml
+++ b/examples/imperative/Cargo.toml
@@ -1,20 +1,8 @@
[package]
name = "futures-example-imperative"
edition = "2018"
-version = "0.3.0"
-authors = ["Alex Crichton "]
-license = "MIT OR Apache-2.0"
-readme = "../README.md"
-keywords = ["futures", "async", "future"]
-repository = "https://github.com/rust-lang/futures-rs"
-homepage = "https://rust-lang.github.io/futures-rs"
-documentation = "https://docs.rs/futures/0.3.0"
-description = """
-An implementation of futures and streams featuring zero allocations,
-composability, and iterator-like interfaces.
-"""
-categories = ["asynchronous"]
+version = "0.1.0"
publish = false
[dependencies]
-futures = { path = "../../futures", version = "0.3.0", features = ["thread-pool"] }
+futures = { path = "../../futures", features = ["thread-pool"] }
diff --git a/examples/imperative/src/main.rs b/examples/imperative/src/main.rs
index ff1afffe27..44f4153cd9 100644
--- a/examples/imperative/src/main.rs
+++ b/examples/imperative/src/main.rs
@@ -34,15 +34,15 @@ fn main() {
// of the stream to be available.
while let Some(v) = rx.next().await {
pending.push(v * 2);
- };
+ }
pending
};
// Actually execute the above future, which will invoke Future::poll and
- // subsequenty chain appropriate Future::poll and methods needing executors
+ // subsequently chain appropriate Future::poll and methods needing executors
// to drive all futures. Eventually fut_values will be driven to completion.
let values: Vec = executor::block_on(fut_values);
println!("Values={:?}", values);
-}
\ No newline at end of file
+}
diff --git a/futures-channel/Cargo.toml b/futures-channel/Cargo.toml
index a15c98abca..f356eabd98 100644
--- a/futures-channel/Cargo.toml
+++ b/futures-channel/Cargo.toml
@@ -1,12 +1,11 @@
[package]
name = "futures-channel"
+version = "0.3.21"
edition = "2018"
-version = "0.3.4"
-authors = ["Alex Crichton "]
+rust-version = "1.45"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/futures-rs"
homepage = "https://rust-lang.github.io/futures-rs"
-documentation = "https://docs.rs/futures-channel/0.3.0"
description = """
Channels for asynchronous communication using futures-rs.
"""
@@ -17,19 +16,19 @@ std = ["alloc", "futures-core/std"]
alloc = ["futures-core/alloc"]
sink = ["futures-sink"]
-# Unstable features
-# These features are outside of the normal semver guarantees and require the
-# `unstable` feature as an explicit opt-in to unstable API.
-unstable = ["futures-core/unstable"]
-cfg-target-has-atomic = ["futures-core/cfg-target-has-atomic"]
+# These features are no longer used.
+# TODO: remove in the next major version.
+unstable = []
+cfg-target-has-atomic = []
[dependencies]
-futures-core = { path = "../futures-core", version = "0.3.4", default-features = false }
-futures-sink = { path = "../futures-sink", version = "0.3.4", default-features = false, optional = true }
+futures-core = { path = "../futures-core", version = "0.3.21", default-features = false }
+futures-sink = { path = "../futures-sink", version = "0.3.21", default-features = false, optional = true }
[dev-dependencies]
-futures = { path = "../futures", version = "0.3.4", default-features = true }
-futures-test = { path = "../futures-test", version = "0.3.4", default-features = true }
+futures = { path = "../futures", default-features = true }
+futures-test = { path = "../futures-test", default-features = true }
[package.metadata.docs.rs]
all-features = true
+rustdoc-args = ["--cfg", "docsrs"]
diff --git a/futures-channel/README.md b/futures-channel/README.md
new file mode 100644
index 0000000000..3287be924c
--- /dev/null
+++ b/futures-channel/README.md
@@ -0,0 +1,23 @@
+# futures-channel
+
+Channels for asynchronous communication using futures-rs.
+
+## Usage
+
+Add this to your `Cargo.toml`:
+
+```toml
+[dependencies]
+futures-channel = "0.3"
+```
+
+The current `futures-channel` requires Rust 1.45 or later.
+
+## License
+
+Licensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or
+[MIT license](LICENSE-MIT) at your option.
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall
+be dual licensed as above, without any additional terms or conditions.
diff --git a/futures-channel/benches/sync_mpsc.rs b/futures-channel/benches/sync_mpsc.rs
index e22fe60666..7c3c3d3a80 100644
--- a/futures-channel/benches/sync_mpsc.rs
+++ b/futures-channel/benches/sync_mpsc.rs
@@ -7,8 +7,8 @@ use {
futures::{
channel::mpsc::{self, Sender, UnboundedSender},
ready,
- stream::{Stream, StreamExt},
sink::Sink,
+ stream::{Stream, StreamExt},
task::{Context, Poll},
},
futures_test::task::noop_context,
@@ -25,7 +25,6 @@ fn unbounded_1_tx(b: &mut Bencher) {
// 1000 iterations to avoid measuring overhead of initialization
// Result should be divided by 1000
for i in 0..1000 {
-
// Poll, not ready, park
assert_eq!(Poll::Pending, rx.poll_next_unpin(&mut cx));
@@ -73,7 +72,6 @@ fn unbounded_uncontended(b: &mut Bencher) {
})
}
-
/// A Stream that continuously sends incrementing number of the queue
struct TestSender {
tx: Sender,
@@ -84,9 +82,7 @@ struct TestSender {
impl Stream for TestSender {
type Item = u32;
- fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>)
- -> Poll