Skip to content

Commit

Permalink
Add a comment explaining the (()) idiom for empty structs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfishcode committed Apr 18, 2022
1 parent 7ee72a8 commit 46bf70c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/src/os/windows/io/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ impl TryFrom<HandleOrInvalid> for OwnedHandle {

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

0 comments on commit 46bf70c

Please sign in to comment.