Skip to content

Commit e0c0020

Browse files
committed
Add a comment explaining the (()) idiom for empty structs.
1 parent 2b79098 commit e0c0020

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ impl TryFrom<HandleOrInvalid> for OwnedHandle {
220220

221221
/// This is the error type used by [`HandleOrNull`] when attempting to convert
222222
/// into a handle, to indicate that the value is null.
223+
// The empty field prevents constructing this, and allows extending it in the future.
223224
#[unstable(feature = "io_safety", issue = "87074")]
224225
#[derive(Debug, Clone, PartialEq, Eq)]
225226
pub struct NullHandleError(());
@@ -237,6 +238,7 @@ impl crate::error::Error for NullHandleError {}
237238
/// This is the error type used by [`HandleOrInvalid`] when attempting to
238239
/// convert into a handle, to indicate that the value is
239240
/// `INVALID_HANDLE_VALUE`.
241+
// The empty field prevents constructing this, and allows extending it in the future.
240242
#[unstable(feature = "io_safety", issue = "87074")]
241243
#[derive(Debug, Clone, PartialEq, Eq)]
242244
pub struct InvalidHandleError(());

0 commit comments

Comments
 (0)