@@ -256,6 +256,7 @@ pub struct Stdin {
256
256
/// Ok(())
257
257
/// }
258
258
/// ```
259
+ #[ must_use = "if unused stdin will immediately unlock" ]
259
260
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
260
261
pub struct StdinLock < ' a > {
261
262
inner : MutexGuard < ' a , BufReader < StdinRaw > > ,
@@ -624,6 +625,7 @@ pub struct Stdout {
624
625
/// When operating in a console, the Windows implementation of this stream does not support
625
626
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
626
627
/// an error.
628
+ #[ must_use = "if unused stdout will immediately unlock" ]
627
629
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
628
630
pub struct StdoutLock < ' a > {
629
631
inner : ReentrantMutexGuard < ' a , RefCell < LineWriter < StdoutRaw > > > ,
@@ -907,6 +909,7 @@ pub struct Stderr {
907
909
/// When operating in a console, the Windows implementation of this stream does not support
908
910
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
909
911
/// an error.
912
+ #[ must_use = "if unused stderr will immediately unlock" ]
910
913
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
911
914
pub struct StderrLock < ' a > {
912
915
inner : ReentrantMutexGuard < ' a , RefCell < StderrRaw > > ,
0 commit comments