From 03e2e864f37c565d209f3118da771cd2c9f1d680 Mon Sep 17 00:00:00 2001 From: Balthild Ires Date: Sat, 29 Dec 2018 04:12:31 +0800 Subject: [PATCH] Stablize pin feature (#814) Box::pinned has been renamed to Box::pin. Meanwhile, the pin feature no longer requires an attribute to enable. Fixes: #813 --- tokio-async-await/README.md | 3 ++- tokio-async-await/src/compat/backward.rs | 2 +- tokio-async-await/src/lib.rs | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tokio-async-await/README.md b/tokio-async-await/README.md index 53fe6134e..3ed1f2a14 100644 --- a/tokio-async-await/README.md +++ b/tokio-async-await/README.md @@ -8,7 +8,8 @@ guarantees. You are living on the edge here.** ## Usage -To use this crate, you need to start with a Rust 2018 edition crate. +To use this crate, you need to start with a Rust 2018 edition crate, with rustc +1.33.0-nightly or later. Add this to your `Cargo.toml`: diff --git a/tokio-async-await/src/compat/backward.rs b/tokio-async-await/src/compat/backward.rs index b4e725472..53a3fdf5a 100644 --- a/tokio-async-await/src/compat/backward.rs +++ b/tokio-async-await/src/compat/backward.rs @@ -19,7 +19,7 @@ pub struct Compat(Pin>); impl Compat { /// Create a new `Compat` backed by `future`. pub fn new(future: T) -> Compat { - Compat(Box::pinned(future)) + Compat(Box::pin(future)) } } diff --git a/tokio-async-await/src/lib.rs b/tokio-async-await/src/lib.rs index 8d4915b9d..b06b5b7e9 100644 --- a/tokio-async-await/src/lib.rs +++ b/tokio-async-await/src/lib.rs @@ -5,7 +5,6 @@ async_await, await_macro, futures_api, - pin, )] #![doc(html_root_url = "https://docs.rs/tokio-async-await/0.1.4")]