about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-12-21 02:47:41 +0100
committerGitHub <noreply@github.com>2020-12-21 02:47:41 +0100
commit432b3550d2d2bcaaa170a6b3f5ebbc2f53e5f2c6 (patch)
treea20076933440e0f71252f40aec9ecb5ffa5f3d55
parentd729e764926bba02422115d5c60e51519de50dea (diff)
parentb228be20c224ab6dfa9498935515bf925d4503b3 (diff)
downloadrust-432b3550d2d2bcaaa170a6b3f5ebbc2f53e5f2c6.tar.gz
rust-432b3550d2d2bcaaa170a6b3f5ebbc2f53e5f2c6.zip
Rollup merge of #80171 - pierwill:pierwill-rustcmiddle-tykind, r=lcnr
Edit rustc_middle::ty::TyKind docs

- Add a definition for this enum.
- Fix typo and missing punctuation.
- Spell out "algebraic data type".
-rw-r--r--compiler/rustc_middle/src/ty/sty.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs
index 81ee05d4b23..dc72a713a7d 100644
--- a/compiler/rustc_middle/src/ty/sty.rs
+++ b/compiler/rustc_middle/src/ty/sty.rs
@@ -88,6 +88,8 @@ impl BoundRegionKind {
     }
 }
 
+/// 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)`.