mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-07 04:23:30 +00:00
Add a comment explaining the (())
idiom for empty structs.
This commit is contained in:
parent
f934043c17
commit
890125d73e
@ -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(());
|
||||
@ -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(());
|
||||
|
Loading…
Reference in New Issue
Block a user