Explain the () argument to ErrorGuaranteed.

This commit is contained in:
Nicholas Nethercote 2023-10-30 18:11:23 +11:00
parent b0a07595b5
commit d76661bf25

View File

@ -2247,6 +2247,9 @@ where
/// Useful type to use with `Result<>` indicate that an error has already
/// been reported to the user, so no need to continue checking.
///
/// The `()` field is necessary: it is non-`pub`, which means values of this
/// type cannot be constructed outside of this crate.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
#[derive(HashStable_Generic)]
pub struct ErrorGuaranteed(());