@@ -190,6 +190,8 @@ pub struct TyParam {
190
190
pub span : Span
191
191
}
192
192
193
+ /// Represents lifetimes and type parameters attached to a declaration
194
+ /// of a function, enum, trait, etc.
193
195
#[ deriving( Clone , PartialEq , Eq , Encodable , Decodable , Hash ) ]
194
196
pub struct Generics {
195
197
pub lifetimes : Vec < Lifetime > ,
@@ -288,7 +290,7 @@ pub enum Pat_ {
288
290
PatWild ,
289
291
PatWildMulti ,
290
292
// A PatIdent may either be a new bound variable,
291
- // or a nullary enum (in which case the second field
293
+ // or a nullary enum (in which case the third field
292
294
// is None).
293
295
// In the nullary enum case, the parser can't determine
294
296
// which it is. The resolver determines this, and
@@ -453,10 +455,10 @@ pub enum Expr_ {
453
455
ExprCast ( Gc < Expr > , P < Ty > ) ,
454
456
ExprIf ( Gc < Expr > , P < Block > , Option < Gc < Expr > > ) ,
455
457
ExprWhile ( Gc < Expr > , P < Block > ) ,
456
- // FIXME #6993: change to Option<Name>
458
+ // FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
457
459
ExprForLoop ( Gc < Pat > , Gc < Expr > , P < Block > , Option < Ident > ) ,
458
460
// Conditionless loop (can be exited with break, cont, or ret)
459
- // FIXME #6993: change to Option<Name>
461
+ // FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
460
462
ExprLoop ( P < Block > , Option < Ident > ) ,
461
463
ExprMatch ( Gc < Expr > , Vec < Arm > ) ,
462
464
ExprFnBlock ( P < FnDecl > , P < Block > ) ,
@@ -468,9 +470,8 @@ pub enum Expr_ {
468
470
ExprField ( Gc < Expr > , SpannedIdent , Vec < P < Ty > > ) ,
469
471
ExprIndex ( Gc < Expr > , Gc < Expr > ) ,
470
472
471
- /// Expression that looks like a "name". For example,
472
- /// `std::slice::from_elem::<uint>` is an ExprPath that's the "name" part
473
- /// of a function call.
473
+ /// Variable reference, possibly containing `::` and/or
474
+ /// type parameters, e.g. foo::bar::<baz>
474
475
ExprPath ( Path ) ,
475
476
476
477
ExprAddrOf ( Mutability , Gc < Expr > ) ,
@@ -643,6 +644,8 @@ pub struct TypeField {
643
644
pub span : Span ,
644
645
}
645
646
647
+ /// Represents a required method in a trait declaration,
648
+ /// one without a default implementation
646
649
#[ deriving( Clone , PartialEq , Eq , Encodable , Decodable , Hash ) ]
647
650
pub struct TypeMethod {
648
651
pub ident : Ident ,
@@ -656,6 +659,8 @@ pub struct TypeMethod {
656
659
pub vis : Visibility ,
657
660
}
658
661
662
+ /// Represents a method declaration in a trait declaration, possibly
663
+ /// including a default implementation
659
664
// A trait method is either required (meaning it doesn't have an
660
665
// implementation, just a signature) or provided (meaning it has a default
661
666
// implementation).
@@ -741,6 +746,7 @@ impl fmt::Show for Onceness {
741
746
}
742
747
}
743
748
749
+ /// Represents the type of a closure
744
750
#[ deriving( PartialEq , Eq , Encodable , Decodable , Hash ) ]
745
751
pub struct ClosureTy {
746
752
pub lifetimes : Vec < Lifetime > ,
@@ -809,6 +815,7 @@ pub struct InlineAsm {
809
815
pub dialect : AsmDialect
810
816
}
811
817
818
+ /// represents an argument in a function header
812
819
#[ deriving( Clone , PartialEq , Eq , Encodable , Decodable , Hash ) ]
813
820
pub struct Arg {
814
821
pub ty : P < Ty > ,
@@ -836,7 +843,7 @@ impl Arg {
836
843
}
837
844
}
838
845
839
- // represents the header (not the body) of a function declaration
846
+ /// represents the header (not the body) of a function declaration
840
847
#[ deriving( Clone , PartialEq , Eq , Encodable , Decodable , Hash ) ]
841
848
pub struct FnDecl {
842
849
pub inputs : Vec < Arg > ,
@@ -1107,6 +1114,7 @@ pub enum Item_ {
1107
1114
ItemTy ( P < Ty > , Generics ) ,
1108
1115
ItemEnum ( EnumDef , Generics ) ,
1109
1116
ItemStruct ( Gc < StructDef > , Generics ) ,
1117
+ /// Represents a Trait Declaration
1110
1118
ItemTrait ( Generics , Sized , Vec < TraitRef > , Vec < TraitMethod > ) ,
1111
1119
ItemImpl ( Generics ,
1112
1120
Option < TraitRef > , // (optional) trait this impl implements
0 commit comments