diff options
author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-10 18:59:14 +0200 |
---|---|---|
committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-16 17:39:28 +0200 |
commit | 2fd4e584a8a994e3fc8e19113db58e62561fb7e9 (patch) | |
tree | 1e68593353df637ec1f9bf6df97dadd46276efa6 | |
parent | b6269f27d99d7da9e95f0b3fdc53193dc8c42fbe (diff) | |
download | rust-adt-docs-fix.tar.gz |
`AdtDef` is an algebraic data type, not abstract data type.adt-docs-fix
-rw-r--r-- | src/librustc/ty/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 17eb4a8957f..5ca819e12f2 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -1938,9 +1938,15 @@ pub struct FieldDef { pub vis: Visibility, } -/// The definition of an abstract data type -- a struct or enum. +/// The definition of a user-defined type, e.g., a `struct`, `enum`, or `union`. /// /// These are all interned (by `intern_adt_def`) into the `adt_defs` table. +/// +/// The initialism *"Adt"* stands for an [*algebraic data type (ADT)*][adt]. +/// This is slightly wrong because `union`s are not ADTs. +/// Moreover, Rust only allows recursive data types through indirection. +/// +/// [adt]: https://en.wikipedia.org/wiki/Algebraic_data_type pub struct AdtDef { /// `DefId` of the struct, enum or union item. pub did: DefId, |