Skip to content

Commit 6018cac

Browse files
committed
Update toolchain to nightly-2019-08-21 (existential_type deprecated)
`existential_type` deprecated by rust-lang/rust#63180 in favour of `#![feature(type_alias_impl_trait)]`. This change updates the code to use the new syntax and the circle ci configuration.
1 parent 2a5c8ab commit 6018cac

7 files changed

Lines changed: 9 additions & 13 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2
22

33
defaults:
4-
rust_image: &rust_image quay.io/tarilabs/rust_tari-build-with-deps:nightly-2019-07-31
4+
rust_image: &rust_image quay.io/tarilabs/rust_tari-build-with-deps:nightly-2019-08-21
55

66
jobs:
77
test-docs:
@@ -70,7 +70,7 @@ jobs:
7070
- run:
7171
name: Tari source code
7272
command: |
73-
TOOLCHAIN_VERSION=nightly-2019-07-31
73+
TOOLCHAIN_VERSION=nightly-2019-08-21
7474
rustup component add --toolchain $TOOLCHAIN_VERSION rustfmt
7575
cargo fmt --all -- --check
7676
cargo test --all

base_layer/p2p/src/executor/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,9 @@ where
8181

8282
impl<N> IntoFuture for StackBuilder<N> {
8383
type Error = ();
84+
type Future = impl Future<Item = (), Error = ()> + Send;
8485
type Item = ();
8586

86-
existential type Future: Future<Item = (), Error = ()> + Send;
87-
8887
fn into_future(self) -> Self::Future {
8988
future::join_all(self.futures).map(|_| ())
9089
}

base_layer/p2p/src/executor/transport.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,9 @@ mod test {
356356
struct EchoService(Option<oneshot::Receiver<()>>);
357357
impl Service<String> for EchoService {
358358
type Error = ();
359+
type Future = impl Future<Item = String, Error = ()>;
359360
type Response = String;
360361

361-
existential type Future: Future<Item = String, Error = ()>;
362-
363362
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
364363
Ok(().into())
365364
}

base_layer/p2p/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2222

2323
// Used to eliminate the need for boxing futures in many cases.
24-
// Detais here: https://github.com/rust-lang/rfcs/pull/2071
25-
#![feature(existential_type)]
24+
// Tracking issue: https://github.com/rust-lang/rust/issues/63063
25+
#![feature(type_alias_impl_trait)]
2626

2727
#[macro_use]
2828
extern crate futures;

base_layer/p2p/src/services/comms_outbound/service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,9 @@ impl CommsOutboundService {
7878

7979
impl Service<CommsOutboundRequest> for CommsOutboundService {
8080
type Error = CommsOutboundServiceError;
81+
type Future = impl Future<Item = Self::Response, Error = Self::Error>;
8182
type Response = Result<CommsOutboundResponse, CommsOutboundServiceError>;
8283

83-
existential type Future: Future<Item = Self::Response, Error = Self::Error>;
84-
8584
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
8685
Ok(().into())
8786
}

base_layer/p2p/src/services/liveness/service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ impl LivenessService {
125125

126126
impl Service<LivenessRequest> for LivenessService {
127127
type Error = ();
128+
type Future = impl Future<Item = Self::Response, Error = Self::Error>;
128129
type Response = Result<LivenessResponse, LivenessError>;
129130

130-
existential type Future: Future<Item = Self::Response, Error = Self::Error>;
131-
132131
fn poll_ready(&mut self) -> Poll<(), Self::Error> {
133132
Ok(().into())
134133
}

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-07-31
1+
nightly-2019-08-21

0 commit comments

Comments
 (0)