diff options
| author | Dan Gohman <dev@sunfishcode.online> | 2022-04-13 14:32:17 -0700 |
|---|---|---|
| committer | Dan Gohman <dev@sunfishcode.online> | 2022-04-18 16:53:50 -0700 |
| commit | 890125d73e939cda058cf692c6a3ce927fc0898f (patch) | |
| tree | f4e96a5ba3c8fe90e6be7101262a448922351dac | |
| parent | f934043c179eb2d9c1dda4e7a70284e0d9354c82 (diff) | |
| download | rust-890125d73e939cda058cf692c6a3ce927fc0898f.tar.gz rust-890125d73e939cda058cf692c6a3ce927fc0898f.zip | |
Add a comment explaining the `(())` idiom for empty structs.
| -rw-r--r-- | library/std/src/os/windows/io/handle.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/os/windows/io/handle.rs b/library/std/src/os/windows/io/handle.rs index e48f630f76e..e4de52612ef 100644 --- a/library/std/src/os/windows/io/handle.rs +++ b/library/std/src/os/windows/io/handle.rs @@ -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(()); |
