Skip to content

Commit 733ef08

Browse files
committed
Add a comment explaining the (()) idiom for empty structs.
1 parent 0efbd34 commit 733ef08

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
@@ -219,6 +219,7 @@ impl TryFrom<HandleOrInvalid> for OwnedHandle {
219219

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

0 commit comments

Comments
 (0)