Skip to content

0.3 backport #2631

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

Merged
merged 33 commits into from
Aug 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1f6f8d0
Fix Sync impl of BiLockGuard
taiki-e Feb 13, 2022
9e8a784
Fix stable_features warning
taiki-e Feb 13, 2022
a619ea7
Fix clippy::single_match warning
taiki-e Feb 13, 2022
cff6c4c
FuturesUnordered: fix partial iteration (#2574)
wfraser Feb 23, 2022
589687b
Shared: fix false detection of inner panics (#2576)
crepererum Mar 2, 2022
3cefb03
Feat: add Mutex::lock_owned and Mutex::try_lock_owned (#2571)
Sherlock-Holo Mar 8, 2022
a8b98aa
Update no_atomic_cas.rs
taiki-e Mar 15, 2022
03e618b
Fix sentence in try_buffered docs. (#2579)
timleslie Mar 15, 2022
d00d935
Add `select` benchmark (#2582)
414owen Mar 21, 2022
bd8ddd2
Run more tests with Miri (#2584)
taiki-e Mar 21, 2022
b3a3342
Update MIRIFLAGS (#2589)
taiki-e Apr 16, 2022
f54c366
Create copy_buf_abortable, which enables to stop copying in the middl…
kazuki0824 Apr 19, 2022
628881f
Remove `Fuse`s from `select`, and only poll non-terminated streams (#…
414owen May 5, 2022
d11fd00
Remove TryStreamExt::into_async_read Unpin bound (#2599)
khollbach May 11, 2022
b7a4e59
Make run_until_stalled handle self-waking futures (#2593)
khollbach May 11, 2022
dac38c0
Fix rustdoc::broken_intra_doc_links warning (#2602)
taiki-e May 28, 2022
fc55afb
Refactor: prefer early return in `future::select` (#2587)
BastiDood May 28, 2022
de5eee1
Fix minor typo in enter doc comment (#2604)
hasheddan May 29, 2022
f81fdb4
Switch to `FuturesOrdered` dynamically in `try_join_all` (#2556)
ibraheemdev Jun 5, 2022
0db9749
Fix orderings in `LocalPool` waker (#2608)
ibraheemdev Jun 5, 2022
41b9aac
stream: Fix Chunk adapters size hints (#2611)
jefftt Jun 6, 2022
188ae1c
Update minimal version of pin-project to 1.0.11 (#2619)
taiki-e Jul 5, 2022
f338bd0
Add push_front and push_back to FuturesOrdered (#2591)
conorbros Jul 7, 2022
76590e6
`doc(alias)` `pending()` to `never` (#2613)
danielhenrymantilla Jul 7, 2022
bedd2d8
Fix miri test failure (#2621)
taiki-e Jul 9, 2022
ac20761
Run more tests with Miri (#2624)
taiki-e Jul 22, 2022
7f4d0fb
Remove .clippy.toml
taiki-e Jul 22, 2022
9250a34
Remove unnecessarily allowed lints
taiki-e Jul 22, 2022
f46acef
Fix clippy::mem_replace_with_default warning
taiki-e Jul 22, 2022
0ba0f2a
Fix changelog
taiki-e Jul 22, 2022
5dbb2eb
Inline WakerRef functions (#2626)
LunaBorowska Jul 23, 2022
72eeae7
Fix CI failure on 1.45
taiki-e Jul 30, 2022
80e63b9
Update actions/checkout action to v3
taiki-e Aug 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clippy.toml

This file was deleted.

44 changes: 23 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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
Expand All @@ -53,7 +53,7 @@ jobs:
- aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install cross
Expand All @@ -69,11 +69,11 @@ jobs:
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
# When updating this, the reminder to update the minimum required version in README.md and Cargo.toml.
- '1.36'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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.
Expand All @@ -97,15 +97,17 @@ jobs:

util-msrv:
name: cargo +${{ matrix.rust }} build
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
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
- '1.45'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Install cargo-hack
Expand Down Expand Up @@ -136,7 +138,7 @@ jobs:
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
- name: Install cargo-hack
Expand All @@ -148,7 +150,7 @@ jobs:
name: cargo build -Z minimal-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install cargo-hack
Expand All @@ -170,7 +172,7 @@ jobs:
- thumbv6m-none-eabi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: rustup target add ${{ matrix.target }}
Expand Down Expand Up @@ -202,7 +204,7 @@ jobs:
name: cargo bench
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: cargo bench --workspace
Expand All @@ -212,7 +214,7 @@ jobs:
name: cargo hack check --feature-powerset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- name: Install cargo-hack
Expand All @@ -237,7 +239,7 @@ jobs:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: ci/no_atomic_cas.sh
Expand Down Expand Up @@ -270,13 +272,13 @@ jobs:
name: cargo miri test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- 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
- run: cargo miri test --workspace --all-features
env:
MIRIFLAGS: -Zmiri-check-number-validity -Zmiri-symbolic-alignment-check -Zmiri-tag-raw-pointers -Zmiri-disable-isolation
MIRIFLAGS: -Zmiri-strict-provenance -Zmiri-symbolic-alignment-check -Zmiri-disable-isolation
RUSTFLAGS: ${{ env.RUSTFLAGS }} -Z randomize-layout

san:
name: cargo test -Z sanitizer=${{ matrix.sanitizer }}
Expand All @@ -289,7 +291,7 @@ jobs:
- thread
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: rustup component add rust-src
Expand All @@ -306,7 +308,7 @@ jobs:
# name: cargo clippy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/checkout@v3
# - name: Install Rust
# run: rustup toolchain install nightly --component clippy && rustup default nightly
# - run: cargo clippy --workspace --all-features --all-targets
Expand All @@ -315,7 +317,7 @@ jobs:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo fmt --all -- --check
Expand All @@ -324,7 +326,7 @@ jobs:
name: cargo doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update nightly && rustup default nightly
- run: RUSTDOCFLAGS="-D warnings --cfg docsrs" cargo doc --workspace --no-deps --all-features
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.repository_owner == 'rust-lang'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Rust
run: rustup update stable
- run: cargo build --all
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ NOTE: This release has been yanked. See #2310 for details.

NOTE: This release has been yanked. See #2310 for details.

* Fix signature of `LocalSpawn` trait (breaking change -- see #1959)
* Fix signature of `SpawnExt` and `LocalSpawnExt` trait (breaking change -- see #1959)

# 0.3.0 - 2019-11-05

Expand Down
31 changes: 7 additions & 24 deletions futures-channel/tests/mpsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ fn tx_close_gets_none() {

#[test]
fn stress_shared_unbounded() {
#[cfg(miri)]
const AMT: u32 = 100;
#[cfg(not(miri))]
const AMT: u32 = 10000;
const AMT: u32 = if cfg!(miri) { 100 } else { 10000 };
const NTHREADS: u32 = 8;
let (tx, rx) = mpsc::unbounded::<i32>();

Expand Down Expand Up @@ -232,10 +229,7 @@ fn stress_shared_unbounded() {

#[test]
fn stress_shared_bounded_hard() {
#[cfg(miri)]
const AMT: u32 = 100;
#[cfg(not(miri))]
const AMT: u32 = 10000;
const AMT: u32 = if cfg!(miri) { 100 } else { 10000 };
const NTHREADS: u32 = 8;
let (tx, rx) = mpsc::channel::<i32>(0);

Expand Down Expand Up @@ -265,10 +259,7 @@ fn stress_shared_bounded_hard() {
#[allow(clippy::same_item_push)]
#[test]
fn stress_receiver_multi_task_bounded_hard() {
#[cfg(miri)]
const AMT: usize = 100;
#[cfg(not(miri))]
const AMT: usize = 10_000;
const AMT: usize = if cfg!(miri) { 100 } else { 10_000 };
const NTHREADS: u32 = 2;

let (mut tx, rx) = mpsc::channel::<usize>(0);
Expand Down Expand Up @@ -336,10 +327,7 @@ fn stress_receiver_multi_task_bounded_hard() {
/// after sender dropped.
#[test]
fn stress_drop_sender() {
#[cfg(miri)]
const ITER: usize = 100;
#[cfg(not(miri))]
const ITER: usize = 10000;
const ITER: usize = if cfg!(miri) { 100 } else { 10000 };

fn list() -> impl Stream<Item = i32> {
let (tx, rx) = mpsc::channel(1);
Expand Down Expand Up @@ -394,10 +382,9 @@ fn stress_close_receiver_iter() {
}
}

#[cfg_attr(miri, ignore)] // Miri is too slow
#[test]
fn stress_close_receiver() {
const ITER: usize = 10000;
const ITER: usize = if cfg!(miri) { 50 } else { 10000 };

for _ in 0..ITER {
stress_close_receiver_iter();
Expand All @@ -414,10 +401,7 @@ async fn stress_poll_ready_sender(mut sender: mpsc::Sender<u32>, count: u32) {
#[allow(clippy::same_item_push)]
#[test]
fn stress_poll_ready() {
#[cfg(miri)]
const AMT: u32 = 100;
#[cfg(not(miri))]
const AMT: u32 = 1000;
const AMT: u32 = if cfg!(miri) { 100 } else { 1000 };
const NTHREADS: u32 = 8;

/// Run a stress test using the specified channel capacity.
Expand All @@ -444,10 +428,9 @@ fn stress_poll_ready() {
stress(16);
}

#[cfg_attr(miri, ignore)] // Miri is too slow
#[test]
fn try_send_1() {
const N: usize = 3000;
const N: usize = if cfg!(miri) { 100 } else { 3000 };
let (mut tx, rx) = mpsc::channel(0);

let t = thread::spawn(move || {
Expand Down
10 changes: 2 additions & 8 deletions futures-channel/tests/oneshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ fn cancel_notifies() {

#[test]
fn cancel_lots() {
#[cfg(miri)]
const N: usize = 100;
#[cfg(not(miri))]
const N: usize = 20000;
const N: usize = if cfg!(miri) { 100 } else { 20000 };

let (tx, rx) = mpsc::channel::<(Sender<_>, mpsc::Sender<_>)>();
let t = thread::spawn(move || {
Expand Down Expand Up @@ -106,10 +103,7 @@ fn is_canceled() {

#[test]
fn cancel_sends() {
#[cfg(miri)]
const N: usize = 100;
#[cfg(not(miri))]
const N: usize = 20000;
const N: usize = if cfg!(miri) { 100 } else { 20000 };

let (tx, rx) = mpsc::channel::<Sender<_>>();
let t = thread::spawn(move || {
Expand Down
2 changes: 1 addition & 1 deletion futures-executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ futures-util = { path = "../futures-util", version = "0.3.21", default-features
num_cpus = { version = "1.8.0", optional = true }

[dev-dependencies]
futures = { path = "../futures" }
futures = { path = "../futures", features = ["thread-pool"] }

[package.metadata.docs.rs]
all-features = true
Expand Down
2 changes: 1 addition & 1 deletion futures-executor/src/enter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl std::error::Error for EnterError {}
/// executor.
///
/// Executor implementations should call this function before beginning to
/// execute a tasks, and drop the returned [`Enter`](Enter) value after
/// execute a task, and drop the returned [`Enter`](Enter) value after
/// completing task execution:
///
/// ```
Expand Down
Loading