Skip to content

Commit

Permalink
Update toolchain to nightly-2019-08-21 (existential_type deprecated) (#…
Browse files Browse the repository at this point in the history
…694)

Merge pull request #694

existential_type deprecated by rust-lang/rust#63180
in favour of #![feature(type_alias_impl_trait)].

This change updates the code with the new (much better) syntax and the circle
ci configuration (merge after image is built).
  • Loading branch information
CjS77 committed Aug 22, 2019
2 parents 2a5c8ab + 6018cac commit 9b15089
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

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

jobs:
test-docs:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- run:
name: Tari source code
command: |
TOOLCHAIN_VERSION=nightly-2019-07-31
TOOLCHAIN_VERSION=nightly-2019-08-21
rustup component add --toolchain $TOOLCHAIN_VERSION rustfmt
cargo fmt --all -- --check
cargo test --all
Expand Down
3 changes: 1 addition & 2 deletions base_layer/p2p/src/executor/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ where

impl<N> IntoFuture for StackBuilder<N> {
type Error = ();
type Future = impl Future<Item = (), Error = ()> + Send;
type Item = ();

existential type Future: Future<Item = (), Error = ()> + Send;

fn into_future(self) -> Self::Future {
future::join_all(self.futures).map(|_| ())
}
Expand Down
3 changes: 1 addition & 2 deletions base_layer/p2p/src/executor/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,9 @@ mod test {
struct EchoService(Option<oneshot::Receiver<()>>);
impl Service<String> for EchoService {
type Error = ();
type Future = impl Future<Item = String, Error = ()>;
type Response = String;

existential type Future: Future<Item = String, Error = ()>;

fn poll_ready(&mut self) -> Poll<(), Self::Error> {
Ok(().into())
}
Expand Down
4 changes: 2 additions & 2 deletions base_layer/p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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

#[macro_use]
extern crate futures;
Expand Down
3 changes: 1 addition & 2 deletions base_layer/p2p/src/services/comms_outbound/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ impl CommsOutboundService {

impl Service<CommsOutboundRequest> for CommsOutboundService {
type Error = CommsOutboundServiceError;
type Future = impl Future<Item = Self::Response, Error = Self::Error>;
type Response = Result<CommsOutboundResponse, CommsOutboundServiceError>;

existential type Future: Future<Item = Self::Response, Error = Self::Error>;

fn poll_ready(&mut self) -> Poll<(), Self::Error> {
Ok(().into())
}
Expand Down
3 changes: 1 addition & 2 deletions base_layer/p2p/src/services/liveness/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ impl LivenessService {

impl Service<LivenessRequest> for LivenessService {
type Error = ();
type Future = impl Future<Item = Self::Response, Error = Self::Error>;
type Response = Result<LivenessResponse, LivenessError>;

existential type Future: Future<Item = Self::Response, Error = Self::Error>;

fn poll_ready(&mut self) -> Poll<(), Self::Error> {
Ok(().into())
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2019-07-31
nightly-2019-08-21

0 comments on commit 9b15089

Please sign in to comment.