Skip to content

Commit 88e501e

Browse files
authored
Rollup merge of #64357 - rust-lang:adt-docs-fix, r=varkor
`AdtDef` is an algebraic data type, not abstract data type r? @varkor
2 parents a44881d + 2fd4e58 commit 88e501e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc/ty/mod.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1938,9 +1938,15 @@ pub struct FieldDef {
19381938
pub vis: Visibility,
19391939
}
19401940

1941-
/// The definition of an abstract data type -- a struct or enum.
1941+
/// The definition of a user-defined type, e.g., a `struct`, `enum`, or `union`.
19421942
///
19431943
/// These are all interned (by `intern_adt_def`) into the `adt_defs` table.
1944+
///
1945+
/// The initialism *"Adt"* stands for an [*algebraic data type (ADT)*][adt].
1946+
/// This is slightly wrong because `union`s are not ADTs.
1947+
/// Moreover, Rust only allows recursive data types through indirection.
1948+
///
1949+
/// [adt]: https://en.wikipedia.org/wiki/Algebraic_data_type
19441950
pub struct AdtDef {
19451951
/// `DefId` of the struct, enum or union item.
19461952
pub did: DefId,

0 commit comments

Comments
 (0)