Skip to content

Commit

Permalink
Update description of Empty Enum for accuracy
Browse files Browse the repository at this point in the history
An empty enum is similar to the never type `!`, rather than the unit type `()`.
  • Loading branch information
Enet4 authored Oct 23, 2020
1 parent a9cd294 commit efedcb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/std/src/keyword_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,15 @@ mod else_keyword {}
/// When data follows along with a variant, such as with rust's built-in [`Option`] type, the data
/// is added as the type describes, for example `Option::Some(123)`. The same follows with
/// struct-like variants, with things looking like `ComplexEnum::LotsOfThings { usual_struct_stuff:
/// true, blah: "hello!".to_string(), }`. Empty Enums are similar to () in that they cannot be
/// true, blah: "hello!".to_string(), }`. Empty Enums are similar to [`!`] in that they cannot be
/// instantiated at all, and are used mainly to mess with the type system in interesting ways.
///
/// For more information, take a look at the [Rust Book] or the [Reference]
///
/// [ADT]: https://en.wikipedia.org/wiki/Algebraic_data_type
/// [Rust Book]: ../book/ch06-01-defining-an-enum.html
/// [Reference]: ../reference/items/enumerations.html
/// [`!`]: primitive.never.html
mod enum_keyword {}

#[doc(keyword = "extern")]
Expand Down

0 comments on commit efedcb2

Please sign in to comment.