From 3dcad984b4c492196118cc6249e2d79b0415a279 Mon Sep 17 00:00:00 2001 From: k-nasa Date: Sat, 2 Nov 2019 12:29:54 +0900 Subject: [PATCH] fix: To unstable feature --- src/io/stderr.rs | 7 ++++++- src/io/stdin.rs | 7 ++++++- src/io/stdout.rs | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/io/stderr.rs b/src/io/stderr.rs index 8986d48..a0d9b71 100644 --- a/src/io/stderr.rs +++ b/src/io/stderr.rs @@ -1,4 +1,3 @@ -use once_cell::sync::Lazy; use std::io::Write as StdWrite; use std::pin::Pin; use std::sync::Mutex; @@ -7,6 +6,10 @@ use crate::future::Future; use crate::io::{self, Write}; use crate::task::{spawn_blocking, Context, JoinHandle, Poll}; +cfg_unstable! { + use once_cell::sync::Lazy; +} + /// Constructs a new handle to the standard error of the current process. /// /// This function is an async version of [`std::io::stderr`]. @@ -119,6 +122,8 @@ impl Stderr { /// # /// # Ok(()) }) } /// ``` + #[cfg_attr(feature = "docs", doc(cfg(unstable)))] + #[cfg(any(feature = "unstable", feature = "docs"))] pub async fn lock(&self) -> StderrLock<'static> { static STDERR: Lazy = Lazy::new(std::io::stderr); diff --git a/src/io/stdin.rs b/src/io/stdin.rs index d7b2690..e5bb508 100644 --- a/src/io/stdin.rs +++ b/src/io/stdin.rs @@ -1,4 +1,3 @@ -use once_cell::sync::Lazy; use std::pin::Pin; use std::sync::Mutex; @@ -6,6 +5,10 @@ use crate::future::{self, Future}; use crate::io::{self, Read}; use crate::task::{spawn_blocking, Context, JoinHandle, Poll}; +cfg_unstable! { + use once_cell::sync::Lazy; +} + /// Constructs a new handle to the standard input of the current process. /// /// This function is an async version of [`std::io::stdin`]. @@ -175,6 +178,8 @@ impl Stdin { /// # /// # Ok(()) }) } /// ``` + #[cfg_attr(feature = "docs", doc(cfg(unstable)))] + #[cfg(any(feature = "unstable", feature = "docs"))] pub async fn lock(&self) -> StdinLock<'static> { static STDIN: Lazy = Lazy::new(std::io::stdin); diff --git a/src/io/stdout.rs b/src/io/stdout.rs index c6281d7..bf22128 100644 --- a/src/io/stdout.rs +++ b/src/io/stdout.rs @@ -1,4 +1,3 @@ -use once_cell::sync::Lazy; use std::io::Write as StdWrite; use std::pin::Pin; use std::sync::Mutex; @@ -7,6 +6,10 @@ use crate::future::Future; use crate::io::{self, Write}; use crate::task::{spawn_blocking, Context, JoinHandle, Poll}; +cfg_unstable! { + use once_cell::sync::Lazy; +} + /// Constructs a new handle to the standard output of the current process. /// /// This function is an async version of [`std::io::stdout`]. @@ -119,6 +122,8 @@ impl Stdout { /// # /// # Ok(()) }) } /// ``` + #[cfg_attr(feature = "docs", doc(cfg(unstable)))] + #[cfg(any(feature = "unstable", feature = "docs"))] pub async fn lock(&self) -> StdoutLock<'static> { static STDOUT: Lazy = Lazy::new(std::io::stdout);