mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Add #[must_use] to stdin/stdout/stderr locks
This commit is contained in:
parent
f8751436ff
commit
e27bfb6e23
@ -256,6 +256,7 @@ pub struct Stdin {
|
|||||||
/// Ok(())
|
/// Ok(())
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
#[must_use = "if unused stdin will immediately unlock"]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub struct StdinLock<'a> {
|
pub struct StdinLock<'a> {
|
||||||
inner: MutexGuard<'a, BufReader<StdinRaw>>,
|
inner: MutexGuard<'a, BufReader<StdinRaw>>,
|
||||||
@ -624,6 +625,7 @@ pub struct Stdout {
|
|||||||
/// When operating in a console, the Windows implementation of this stream does not support
|
/// When operating in a console, the Windows implementation of this stream does not support
|
||||||
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
|
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
|
||||||
/// an error.
|
/// an error.
|
||||||
|
#[must_use = "if unused stdout will immediately unlock"]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub struct StdoutLock<'a> {
|
pub struct StdoutLock<'a> {
|
||||||
inner: ReentrantMutexGuard<'a, RefCell<LineWriter<StdoutRaw>>>,
|
inner: ReentrantMutexGuard<'a, RefCell<LineWriter<StdoutRaw>>>,
|
||||||
@ -907,6 +909,7 @@ pub struct Stderr {
|
|||||||
/// When operating in a console, the Windows implementation of this stream does not support
|
/// When operating in a console, the Windows implementation of this stream does not support
|
||||||
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
|
/// non-UTF-8 byte sequences. Attempting to write bytes that are not valid UTF-8 will return
|
||||||
/// an error.
|
/// an error.
|
||||||
|
#[must_use = "if unused stderr will immediately unlock"]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
pub struct StderrLock<'a> {
|
pub struct StderrLock<'a> {
|
||||||
inner: ReentrantMutexGuard<'a, RefCell<StderrRaw>>,
|
inner: ReentrantMutexGuard<'a, RefCell<StderrRaw>>,
|
||||||
|
Loading…
Reference in New Issue
Block a user