Skip to content

Commit 2bb7fdb

Browse files
committed
Also document that as_raw_handle may return NULL.
1 parent 4ce68c1 commit 2bb7fdb

File tree

1 file changed

+7
-0
lines changed
  • library/std/src/os/windows/io

1 file changed

+7
-0
lines changed

library/std/src/os/windows/io/raw.rs

+7
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,15 @@ pub trait AsRawHandle {
3232
/// raw handle to the caller, and the handle is only guaranteed
3333
/// to be valid while the original object has not yet been destroyed.
3434
///
35+
/// This function may return null, such as when called on [`Stdin`],
36+
/// [`Stdout`], or [`Stderr`] when the console is detached.
37+
///
3538
/// However, borrowing is not strictly required. See [`AsHandle::as_handle`]
3639
/// for an API which strictly borrows a handle.
40+
///
41+
/// [`Stdin`]: io::Stdin
42+
/// [`Stdout`]: io::Stdout
43+
/// [`Stderr`]: io::Stderr
3744
#[stable(feature = "rust1", since = "1.0.0")]
3845
fn as_raw_handle(&self) -> RawHandle;
3946
}

0 commit comments

Comments
 (0)