@@ -7,6 +7,7 @@ use crate::task::{spawn_blocking, Context, JoinHandle, Poll};
77
88cfg_unstable ! {
99 use once_cell:: sync:: Lazy ;
10+ use std:: io:: Read as _;
1011}
1112
1213/// Constructs a new handle to the standard input of the current process.
@@ -63,9 +64,13 @@ pub struct Stdin(Mutex<State>);
6364///
6465/// [`Read`]: trait.Read.html
6566/// [`Stdin::lock`]: struct.Stdin.html#method.lock
67+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
68+ #[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
6669#[ derive( Debug ) ]
6770pub struct StdinLock < ' a > ( std:: io:: StdinLock < ' a > ) ;
6871
72+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
73+ #[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
6974unsafe impl Send for StdinLock < ' _ > { }
7075
7176/// The state of the asynchronous stdin.
@@ -257,14 +262,14 @@ cfg_windows! {
257262 }
258263}
259264
265+ #[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
266+ #[ cfg( any( feature = "unstable" , feature = "docs" ) ) ]
260267impl Read for StdinLock < ' _ > {
261268 fn poll_read (
262269 mut self : Pin < & mut Self > ,
263270 _cx : & mut Context < ' _ > ,
264271 buf : & mut [ u8 ] ,
265272 ) -> Poll < io:: Result < usize > > {
266- use std:: io:: Read as StdRead ;
267-
268273 Poll :: Ready ( self . 0 . read ( buf) )
269274 }
270275}
0 commit comments