about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-12 08:32:03 +0000
committerbors <bors@rust-lang.org>2014-11-12 08:32:03 +0000
commita2dee35e015ade54bf0932e9f58e057dab01b9c9 (patch)
tree13a33fec6fb88083ab0bb71b81d60e7a69170c3b /src/libsyntax
parent4d5e7f32492a5cc18f806fa96c3d863fa95fe688 (diff)
parent37afc528eacf4a0a874f8e97f6e7d4d7b63e8ac6 (diff)
downloadrust-a2dee35e015ade54bf0932e9f58e057dab01b9c9.tar.gz
rust-a2dee35e015ade54bf0932e9f58e057dab01b9c9.zip
auto merge of #18841 : Manishearth/rust/doc-ty, r=alexcrichton
I'll probably start documenting the rest of `syntax::ast` whenever I get time.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 145978bb73f..639adb45078 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1084,24 +1084,40 @@ pub struct BareFnTy {
 }
 
 #[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
+/// The different kinds of types recognized by the compiler
 pub enum Ty_ {
+    /// The unit type (`()`)
     TyNil,
-    TyBot, /* bottom type */
+    /// The bottom type (`!`)
+    TyBot,
     TyUniq(P<Ty>),
+    /// An array (`[T]`)
     TyVec(P<Ty>),
+    /// A fixed length array (`[T, ..n]`)
     TyFixedLengthVec(P<Ty>, P<Expr>),
+    /// A raw pointer (`*const T` or `*mut T`)
     TyPtr(MutTy),
+    /// A reference (`&'a T` or `&'a mut T`)
     TyRptr(Option<Lifetime>, MutTy),
+    /// A closure (e.g. `|uint| -> bool`)
     TyClosure(P<ClosureTy>),
+    /// A procedure (e.g `proc(uint) -> bool`)
     TyProc(P<ClosureTy>),
+    /// A bare function (e.g. `fn(uint) -> bool`)
     TyBareFn(P<BareFnTy>),
+    /// A tuple (`(A, B, C, D,...)`)
     TyTup(Vec<P<Ty>> ),
+    /// A path (`module::module::...::Type`) or primitive
+    ///
+    /// Type parameters are stored in the Path itself
     TyPath(Path, Option<TyParamBounds>, NodeId), // for #7264; see above
-    TyPolyTraitRef(P<PolyTraitRef>), // a type like `for<'a> Foo<&'a Bar>`
+    /// A type like `for<'a> Foo<&'a Bar>`
+    TyPolyTraitRef(P<PolyTraitRef>),
     /// A "qualified path", e.g. `<Vec<T> as SomeTrait>::SomeType`
     TyQPath(P<QPath>),
     /// No-op; kept solely so that we can pretty-print faithfully
     TyParen(P<Ty>),
+    /// Unused for now
     TyTypeof(P<Expr>),
     /// TyInfer means the type should be inferred instead of it having been
     /// specified. This can appear anywhere in a type.