diff options
| author | Eduardo Pinho <enet4mikeenet@gmail.com> | 2020-10-23 12:13:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-23 12:13:07 +0100 |
| commit | efedcb23447a805fad841c4e38d5dea0d53ec3c7 (patch) | |
| tree | e544a8b49512d0554bbfe9c0a342928960681b51 | |
| parent | a9cd294cf2775441e713c7ee2918b728733b99f5 (diff) | |
| download | rust-efedcb23447a805fad841c4e38d5dea0d53ec3c7.tar.gz rust-efedcb23447a805fad841c4e38d5dea0d53ec3c7.zip | |
Update description of Empty Enum for accuracy
An empty enum is similar to the never type `!`, rather than the unit type `()`.
| -rw-r--r-- | library/std/src/keyword_docs.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs index a4bbb18da59..9b704ee9eca 100644 --- a/library/std/src/keyword_docs.rs +++ b/library/std/src/keyword_docs.rs @@ -346,7 +346,7 @@ 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] @@ -354,6 +354,7 @@ mod else_keyword {} /// [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")] |
