Skip to content

Commit efedcb2

Browse files
authored
Update description of Empty Enum for accuracy
An empty enum is similar to the never type `!`, rather than the unit type `()`.
1 parent a9cd294 commit efedcb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: library/std/src/keyword_docs.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,15 @@ mod else_keyword {}
346346
/// When data follows along with a variant, such as with rust's built-in [`Option`] type, the data
347347
/// is added as the type describes, for example `Option::Some(123)`. The same follows with
348348
/// struct-like variants, with things looking like `ComplexEnum::LotsOfThings { usual_struct_stuff:
349-
/// true, blah: "hello!".to_string(), }`. Empty Enums are similar to () in that they cannot be
349+
/// true, blah: "hello!".to_string(), }`. Empty Enums are similar to [`!`] in that they cannot be
350350
/// instantiated at all, and are used mainly to mess with the type system in interesting ways.
351351
///
352352
/// For more information, take a look at the [Rust Book] or the [Reference]
353353
///
354354
/// [ADT]: https://en.wikipedia.org/wiki/Algebraic_data_type
355355
/// [Rust Book]: ../book/ch06-01-defining-an-enum.html
356356
/// [Reference]: ../reference/items/enumerations.html
357+
/// [`!`]: primitive.never.html
357358
mod enum_keyword {}
358359

359360
#[doc(keyword = "extern")]

0 commit comments

Comments
 (0)