Skip to content

Commit 2a057a3

Browse files
authored
Merge branch 'master' into fix-stream-forward-impl
2 parents 8a2d6f7 + 380a88b commit 2a057a3

File tree

183 files changed

+1362
-1412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+1362
-1412
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ target/
33
Cargo.lock
44
_site
55
.sass-cache
6+
.idea
7+
.DS_Store

.travis.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ matrix:
2525

2626
# When updating this, the reminder to update the minimum required version in README.md.
2727
- name: cargo test (minimum required version)
28-
rust: nightly-2019-01-11
28+
rust: nightly-2019-02-15
2929

3030
- name: cargo clippy
3131
rust: nightly
@@ -64,17 +64,26 @@ matrix:
6464
script:
6565
- cargo build --manifest-path futures/Cargo.toml --features io-compat
6666

67-
# Allow build fail until #1396 is fixed.
6867
- name: cargo build --target=thumbv6m-none-eabi
6968
rust: nightly
70-
env: ALLOW_FAILURES=true
7169
install:
7270
- rustup target add thumbv6m-none-eabi
7371
script:
72+
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
7473
- cargo build --manifest-path futures/Cargo.toml
7574
--target thumbv6m-none-eabi
7675
--no-default-features
77-
--features nightly
76+
--features nightly,cfg-target-has-atomic
77+
78+
- name: cargo build --target=thumbv7m-none-eabi
79+
rust: nightly
80+
install:
81+
- rustup target add thumbv7m-none-eabi
82+
script:
83+
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
84+
- cargo build --manifest-path futures/Cargo.toml
85+
--target thumbv7m-none-eabi
86+
--no-default-features
7887

7988
- name: cargo doc
8089
rust: nightly
@@ -102,10 +111,6 @@ matrix:
102111
- git commit -m "Add API docs for $TRAVIS_TAG"
103112
- git push origin master
104113

105-
allow_failures:
106-
- rust: nightly
107-
env: ALLOW_FAILURES=true
108-
109114
script:
110115
- cargo test --all --all-features
111116
- cargo test --all --all-features --release

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# 0.3.0-alpha.13 - 2019-2-20
2+
* Updated to new nightly with stabilization candidate API.
3+
* Removed `LocalWaker`.
4+
* Added `#[must_use]` to `Stream` and `Sink` traits.
5+
* Enabled using `!Unpin` futures in `JoinAll`.
6+
* Added the `try_join_all` combinator.
7+
* Stopped closing a whole channel upon closing of one sender.
8+
* Removed `TokioDefaultSpawner` and `tokio-compat`.
9+
* Moved intra-crate dependencies to exact versions.
10+
111
# 0.3.0-alpha.12 - 2019-1-14
212
* Updated to new nightly with a modification to `Pin::set`.
313
* Expose `AssertUnmoved` and `PendingOnce`.

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</p>
1818

1919
<p align="center">
20-
<a href="https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.12/futures/">
20+
<a href="https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.13/futures/">
2121
Documentation
2222
</a> | <a href="https://rust-lang-nursery.github.io/futures-rs/">
2323
Website
@@ -30,7 +30,7 @@ Add this to your `Cargo.toml`:
3030

3131
```toml
3232
[dependencies]
33-
futures-preview = "0.3.0-alpha.12"
33+
futures-preview = "0.3.0-alpha.13"
3434
```
3535

3636
Now, you can use futures-rs:
@@ -39,7 +39,7 @@ Now, you can use futures-rs:
3939
use futures::future::Future; // Note: It's not `futures_preview`
4040
```
4141

42-
The current version of futures-rs requires Rust nightly 2019-01-11 or later.
42+
The current version of futures-rs requires Rust nightly 2019-02-15 or later.
4343

4444
### Feature `std`
4545

@@ -49,7 +49,7 @@ a `#[no_std]` environment, use:
4949

5050
```toml
5151
[dependencies]
52-
futures-preview = { version = "=0.3.0-alpha.12", default-features = false }
52+
futures-preview = { version = "=0.3.0-alpha.13", default-features = false }
5353
```
5454

5555
# License

ci/remove-dev-dependencies/Cargo.toml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[package]
2+
name = "remove-dev-dependencies"
3+
version = "0.1.0"
4+
authors = ["Wim Looman <[email protected]>"]
5+
edition = "2018"
6+
publish = false
7+
8+
[workspace]
9+
10+
[dependencies]
11+
toml_edit = "0.1.3"
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use std::{env, error::Error, fs};
2+
3+
fn main() -> Result<(), Box<dyn Error>> {
4+
for file in env::args().skip(1) {
5+
let content = fs::read_to_string(&file)?;
6+
let mut doc: toml_edit::Document = content.parse()?;
7+
doc.as_table_mut().remove("dev-dependencies");
8+
fs::write(file, doc.to_string())?;
9+
}
10+
11+
Ok(())
12+
}

futures-channel/Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
22
name = "futures-channel-preview"
33
edition = "2018"
4-
version = "0.3.0-alpha.12"
4+
version = "0.3.0-alpha.13"
55
authors = ["Alex Crichton <[email protected]>"]
66
license = "MIT OR Apache-2.0"
77
repository = "https://github.com/rust-lang-nursery/futures-rs"
88
homepage = "https://rust-lang-nursery.github.io/futures-rs"
9-
documentation = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.12/futures_channel"
9+
documentation = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.13/futures_channel"
1010
description = """
1111
Channels for asynchronous communication using futures-rs.
1212
"""
@@ -19,9 +19,9 @@ std = ["futures-core-preview/std"]
1919
default = ["std"]
2020

2121
[dependencies]
22-
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.12", default-features = false }
22+
futures-core-preview = { path = "../futures-core", version = "=0.3.0-alpha.13", default-features = false }
2323

2424
[dev-dependencies]
25-
futures-preview = { path = "../futures", version = "=0.3.0-alpha.12", default-features = true }
26-
futures-test-preview = { path = "../futures-test", version = "=0.3.0-alpha.12", default-features = true }
25+
futures-preview = { path = "../futures", version = "=0.3.0-alpha.13", default-features = true }
26+
futures-test-preview = { path = "../futures-test", version = "=0.3.0-alpha.13", default-features = true }
2727
pin-utils = "0.1.0-alpha.4"

futures-channel/benches/sync_mpsc.rs

+21-21
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ use {
99
ready,
1010
stream::{Stream, StreamExt},
1111
sink::Sink,
12-
task::{LocalWaker, Poll},
12+
task::{Waker, Poll},
1313
},
14-
futures_test::task::noop_local_waker_ref,
14+
futures_test::task::noop_waker_ref,
1515
std::pin::Pin,
1616
};
1717

1818
/// Single producer, single consumer
1919
#[bench]
2020
fn unbounded_1_tx(b: &mut Bencher) {
21-
let lw = noop_local_waker_ref();
21+
let waker = noop_waker_ref();
2222
b.iter(|| {
2323
let (tx, mut rx) = mpsc::unbounded();
2424

@@ -27,20 +27,20 @@ fn unbounded_1_tx(b: &mut Bencher) {
2727
for i in 0..1000 {
2828

2929
// Poll, not ready, park
30-
assert_eq!(Poll::Pending, rx.poll_next_unpin(lw));
30+
assert_eq!(Poll::Pending, rx.poll_next_unpin(waker));
3131

3232
UnboundedSender::unbounded_send(&tx, i).unwrap();
3333

3434
// Now poll ready
35-
assert_eq!(Poll::Ready(Some(i)), rx.poll_next_unpin(lw));
35+
assert_eq!(Poll::Ready(Some(i)), rx.poll_next_unpin(waker));
3636
}
3737
})
3838
}
3939

4040
/// 100 producers, single consumer
4141
#[bench]
4242
fn unbounded_100_tx(b: &mut Bencher) {
43-
let lw = noop_local_waker_ref();
43+
let waker = noop_waker_ref();
4444
b.iter(|| {
4545
let (tx, mut rx) = mpsc::unbounded();
4646

@@ -49,26 +49,26 @@ fn unbounded_100_tx(b: &mut Bencher) {
4949
// 1000 send/recv operations total, result should be divided by 1000
5050
for _ in 0..10 {
5151
for i in 0..tx.len() {
52-
assert_eq!(Poll::Pending, rx.poll_next_unpin(lw));
52+
assert_eq!(Poll::Pending, rx.poll_next_unpin(waker));
5353

5454
UnboundedSender::unbounded_send(&tx[i], i).unwrap();
5555

56-
assert_eq!(Poll::Ready(Some(i)), rx.poll_next_unpin(lw));
56+
assert_eq!(Poll::Ready(Some(i)), rx.poll_next_unpin(waker));
5757
}
5858
}
5959
})
6060
}
6161

6262
#[bench]
6363
fn unbounded_uncontended(b: &mut Bencher) {
64-
let lw = noop_local_waker_ref();
64+
let waker = noop_waker_ref();
6565
b.iter(|| {
6666
let (tx, mut rx) = mpsc::unbounded();
6767

6868
for i in 0..1000 {
6969
UnboundedSender::unbounded_send(&tx, i).expect("send");
7070
// No need to create a task, because poll is not going to park.
71-
assert_eq!(Poll::Ready(Some(i)), rx.poll_next_unpin(lw));
71+
assert_eq!(Poll::Ready(Some(i)), rx.poll_next_unpin(waker));
7272
}
7373
})
7474
}
@@ -84,41 +84,41 @@ struct TestSender {
8484
impl Stream for TestSender {
8585
type Item = u32;
8686

87-
fn poll_next(mut self: Pin<&mut Self>, lw: &LocalWaker)
87+
fn poll_next(mut self: Pin<&mut Self>, waker: &Waker)
8888
-> Poll<Option<Self::Item>>
8989
{
9090
let this = &mut *self;
9191
let mut tx = Pin::new(&mut this.tx);
9292

93-
ready!(tx.as_mut().poll_ready(lw)).unwrap();
93+
ready!(tx.as_mut().poll_ready(waker)).unwrap();
9494
tx.as_mut().start_send(this.last + 1).unwrap();
9595
this.last += 1;
96-
assert_eq!(Poll::Ready(Ok(())), tx.as_mut().poll_flush(lw));
96+
assert_eq!(Poll::Ready(Ok(())), tx.as_mut().poll_flush(waker));
9797
Poll::Ready(Some(this.last))
9898
}
9999
}
100100

101101
/// Single producers, single consumer
102102
#[bench]
103103
fn bounded_1_tx(b: &mut Bencher) {
104-
let lw = noop_local_waker_ref();
104+
let waker = noop_waker_ref();
105105
b.iter(|| {
106106
let (tx, mut rx) = mpsc::channel(0);
107107

108108
let mut tx = TestSender { tx, last: 0 };
109109

110110
for i in 0..1000 {
111-
assert_eq!(Poll::Ready(Some(i + 1)), tx.poll_next_unpin(lw));
112-
assert_eq!(Poll::Pending, tx.poll_next_unpin(lw));
113-
assert_eq!(Poll::Ready(Some(i + 1)), rx.poll_next_unpin(lw));
111+
assert_eq!(Poll::Ready(Some(i + 1)), tx.poll_next_unpin(waker));
112+
assert_eq!(Poll::Pending, tx.poll_next_unpin(waker));
113+
assert_eq!(Poll::Ready(Some(i + 1)), rx.poll_next_unpin(waker));
114114
}
115115
})
116116
}
117117

118118
/// 100 producers, single consumer
119119
#[bench]
120120
fn bounded_100_tx(b: &mut Bencher) {
121-
let lw = noop_local_waker_ref();
121+
let waker = noop_waker_ref();
122122
b.iter(|| {
123123
// Each sender can send one item after specified capacity
124124
let (tx, mut rx) = mpsc::channel(0);
@@ -133,11 +133,11 @@ fn bounded_100_tx(b: &mut Bencher) {
133133
for i in 0..10 {
134134
for j in 0..tx.len() {
135135
// Send an item
136-
assert_eq!(Poll::Ready(Some(i + 1)), tx[j].poll_next_unpin(lw));
136+
assert_eq!(Poll::Ready(Some(i + 1)), tx[j].poll_next_unpin(waker));
137137
// Then block
138-
assert_eq!(Poll::Pending, tx[j].poll_next_unpin(lw));
138+
assert_eq!(Poll::Pending, tx[j].poll_next_unpin(waker));
139139
// Recv the item
140-
assert_eq!(Poll::Ready(Some(i + 1)), rx.poll_next_unpin(lw));
140+
assert_eq!(Poll::Ready(Some(i + 1)), rx.poll_next_unpin(waker));
141141
}
142142
}
143143
})

futures-channel/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
1111

12-
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.12/futures_channel")]
12+
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.13/futures_channel")]
1313

1414
#[cfg(feature = "std")]
1515
mod lock;

0 commit comments

Comments
 (0)