]> git.lizzy.rs Git - rust.git/commitdiff
Edit rustc_middle::ty::TyKind docs
authorpierwill <pierwill@users.noreply.github.com>
Fri, 18 Dec 2020 22:17:23 +0000 (14:17 -0800)
committerpierwill <pierwill@users.noreply.github.com>
Sun, 20 Dec 2020 17:14:44 +0000 (09:14 -0800)
- Add a definition for this enum.
- Fix typo and missing punctuation.
- Spell out "algebraic data type".

compiler/rustc_middle/src/ty/sty.rs

index 81ee05d4b23cabcf00e98f208ccefcefaed309c3..dc72a713a7d865ec75de96e0b68d8cda9dc0bc9d 100644 (file)
@@ -88,6 +88,8 @@ pub fn is_named(&self) -> bool {
     }
 }
 
+/// Defines the kinds of types.
+///
 /// N.B., if you change this, you'll probably want to change the corresponding
 /// AST structure in `librustc_ast/ast.rs` as well.
 #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, TyEncodable, TyDecodable, Debug)]
@@ -110,7 +112,7 @@ pub enum TyKind<'tcx> {
     /// A primitive floating-point type. For example, `f64`.
     Float(ast::FloatTy),
 
-    /// Structures, enumerations and unions.
+    /// Algebraic data types (ADT). For example: structures, enumerations and unions.
     ///
     /// InternalSubsts here, possibly against intuition, *may* contain `Param`s.
     /// That is, even after substitution it is possible that there are type
@@ -170,11 +172,11 @@ pub enum TyKind<'tcx> {
     /// `|a| yield a`.
     Generator(DefId, SubstsRef<'tcx>, hir::Movability),
 
-    /// A type representin the types stored inside a generator.
+    /// A type representing the types stored inside a generator.
     /// This should only appear in GeneratorInteriors.
     GeneratorWitness(Binder<&'tcx List<Ty<'tcx>>>),
 
-    /// The never type `!`
+    /// The never type `!`.
     Never,
 
     /// A tuple type. For example, `(i32, bool)`.