Skip to content

Commit b621b8d

Browse files
author
Jakub Bukaj
committed
Merge remote-tracking branch 'Manishearth/doc-ty' into remove-unit
Conflicts: src/libsyntax/ast.rs
2 parents 98ef349 + 37afc52 commit b621b8d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/libsyntax/ast.rs

+15-1
Original file line numberDiff line numberDiff line change
@@ -1083,21 +1083,35 @@ pub struct BareFnTy {
10831083
}
10841084

10851085
#[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash, Show)]
1086+
/// The different kinds of types recognized by the compiler
10861087
pub enum Ty_ {
1088+
/// An array (`[T]`)
10871089
TyVec(P<Ty>),
1090+
/// A fixed length array (`[T, ..n]`)
10881091
TyFixedLengthVec(P<Ty>, P<Expr>),
1092+
/// A raw pointer (`*const T` or `*mut T`)
10891093
TyPtr(MutTy),
1094+
/// A reference (`&'a T` or `&'a mut T`)
10901095
TyRptr(Option<Lifetime>, MutTy),
1096+
/// A closure (e.g. `|uint| -> bool`)
10911097
TyClosure(P<ClosureTy>),
1098+
/// A procedure (e.g `proc(uint) -> bool`)
10921099
TyProc(P<ClosureTy>),
1100+
/// A bare function (e.g. `fn(uint) -> bool`)
10931101
TyBareFn(P<BareFnTy>),
1102+
/// A tuple (`(A, B, C, D,...)`)
10941103
TyTup(Vec<P<Ty>> ),
1104+
/// A path (`module::module::...::Type`) or primitive
1105+
///
1106+
/// Type parameters are stored in the Path itself
10951107
TyPath(Path, Option<TyParamBounds>, NodeId), // for #7264; see above
1096-
TyPolyTraitRef(P<PolyTraitRef>), // a type like `for<'a> Foo<&'a Bar>`
1108+
/// A type like `for<'a> Foo<&'a Bar>`
1109+
TyPolyTraitRef(P<PolyTraitRef>),
10971110
/// A "qualified path", e.g. `<Vec<T> as SomeTrait>::SomeType`
10981111
TyQPath(P<QPath>),
10991112
/// No-op; kept solely so that we can pretty-print faithfully
11001113
TyParen(P<Ty>),
1114+
/// Unused for now
11011115
TyTypeof(P<Expr>),
11021116
/// TyInfer means the type should be inferred instead of it having been
11031117
/// specified. This can appear anywhere in a type.

0 commit comments

Comments
 (0)