Skip to content

Commit d76661b

Browse files
committed
Explain the () argument to ErrorGuaranteed.
1 parent b0a0759 commit d76661b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_span/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2247,6 +2247,9 @@ where
22472247

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

0 commit comments

Comments
 (0)