@@ -215,8 +215,8 @@ pub struct Lifetime {
215
215
pub name : Name
216
216
}
217
217
218
- #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
219
218
/// A lifetime definition, eg `'a: 'b+'c+'d`
219
+ #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
220
220
pub struct LifetimeDef {
221
221
pub lifetime : Lifetime ,
222
222
pub bounds : Vec < Lifetime >
@@ -590,6 +590,7 @@ pub enum Pat_ {
590
590
/// A PatIdent may either be a new bound variable,
591
591
/// or a nullary enum (in which case the third field
592
592
/// is None).
593
+ ///
593
594
/// In the nullary enum case, the parser can't determine
594
595
/// which it is. The resolver determines this, and
595
596
/// records this pattern's NodeId in an auxiliary
@@ -786,18 +787,22 @@ pub enum Expr_ {
786
787
/// An array (`[a, b, c, d]`)
787
788
ExprVec ( Vec < P < Expr > > ) ,
788
789
/// A function call
790
+ ///
789
791
/// The first field resolves to the function itself,
790
792
/// and the second field is the list of arguments
791
793
ExprCall ( P < Expr > , Vec < P < Expr > > ) ,
792
794
/// A method call (`x.foo::<Bar, Baz>(a, b, c, d)`)
793
- /// The `SpannedIdent` is the identifier for the method name
795
+ ///
796
+ /// The `SpannedIdent` is the identifier for the method name.
794
797
/// The vector of `Ty`s are the ascripted type parameters for the method
795
- /// (within the angle brackets)
798
+ /// (within the angle brackets).
799
+ ///
796
800
/// The first element of the vector of `Expr`s is the expression that evaluates
797
801
/// to the object on which the method is being called on (the receiver),
798
802
/// and the remaining elements are the rest of the arguments.
803
+ ///
799
804
/// Thus, `x.foo::<Bar, Baz>(a, b, c, d)` is represented as
800
- /// `ExprMethodCall(foo, [Bar, Baz], [x, a, b, c, d])`
805
+ /// `ExprMethodCall(foo, [Bar, Baz], [x, a, b, c, d])`.
801
806
ExprMethodCall ( SpannedIdent , Vec < P < Ty > > , Vec < P < Expr > > ) ,
802
807
/// A tuple (`(a, b, c ,d)`)
803
808
ExprTup ( Vec < P < Expr > > ) ,
@@ -810,32 +815,41 @@ pub enum Expr_ {
810
815
/// A cast (`foo as f64`)
811
816
ExprCast ( P < Expr > , P < Ty > ) ,
812
817
/// An `if` block, with an optional else block
818
+ ///
813
819
/// `if expr { block } else { expr }`
814
820
ExprIf ( P < Expr > , P < Block > , Option < P < Expr > > ) ,
815
821
/// An `if let` expression with an optional else block
822
+ ///
816
823
/// `if let pat = expr { block } else { expr }`
817
- /// This is desugared to a `match` expression
824
+ ///
825
+ /// This is desugared to a `match` expression.
818
826
ExprIfLet ( P < Pat > , P < Expr > , P < Block > , Option < P < Expr > > ) ,
819
827
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
820
828
/// A while loop, with an optional label
829
+ ///
821
830
/// `'label: while expr { block }`
822
831
ExprWhile ( P < Expr > , P < Block > , Option < Ident > ) ,
823
832
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
824
833
/// A while-let loop, with an optional label
834
+ ///
825
835
/// `'label: while let pat = expr { block }`
826
- /// This is desugared to a combination of `loop` and `match` expressions
836
+ ///
837
+ /// This is desugared to a combination of `loop` and `match` expressions.
827
838
ExprWhileLet ( P < Pat > , P < Expr > , P < Block > , Option < Ident > ) ,
828
839
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
829
840
/// A for loop, with an optional label
841
+ ///
830
842
/// `'label: for pat in expr { block }`
831
- /// This is desugared to a combination of `loop` and `match` expressions
843
+ ///
844
+ /// This is desugared to a combination of `loop` and `match` expressions.
832
845
ExprForLoop ( P < Pat > , P < Expr > , P < Block > , Option < Ident > ) ,
833
846
/// Conditionless loop (can be exited with break, continue, or return)
847
+ ///
834
848
/// `'label: loop { block }`
835
849
// FIXME #6993: change to Option<Name> ... or not, if these are hygienic.
836
850
ExprLoop ( P < Block > , Option < Ident > ) ,
837
851
/// A `match` block, with a source that indicates whether or not it is
838
- /// the result of a desugaring, and if so, which kind
852
+ /// the result of a desugaring, and if so, which kind.
839
853
ExprMatch ( P < Expr > , Vec < Arm > , MatchSource ) ,
840
854
/// A closure (for example, `move |a, b, c| {a + b + c}`)
841
855
ExprClosure ( CaptureClause , P < FnDecl > , P < Block > ) ,
@@ -845,20 +859,24 @@ pub enum Expr_ {
845
859
/// An assignment (`a = foo()`)
846
860
ExprAssign ( P < Expr > , P < Expr > ) ,
847
861
/// An assignment with an operator
848
- /// For example, `a += 1`
862
+ ///
863
+ /// For example, `a += 1`.
849
864
ExprAssignOp ( BinOp , P < Expr > , P < Expr > ) ,
850
865
/// Access of a named struct field (`obj.foo`)
851
866
ExprField ( P < Expr > , SpannedIdent ) ,
852
867
/// Access of an unnamed field of a struct or tuple-struct
853
- /// For example, `foo.0`
868
+ ///
869
+ /// For example, `foo.0`.
854
870
ExprTupField ( P < Expr > , Spanned < usize > ) ,
855
871
/// An indexing operation (`foo[2]`)
856
872
ExprIndex ( P < Expr > , P < Expr > ) ,
857
873
/// A range (`1..2`, `1..`, or `..2`)
858
874
ExprRange ( Option < P < Expr > > , Option < P < Expr > > ) ,
859
875
860
876
/// Variable reference, possibly containing `::` and/or type
861
- /// parameters, e.g. foo::bar::<baz>. Optionally "qualified",
877
+ /// parameters, e.g. foo::bar::<baz>.
878
+ ///
879
+ /// Optionally "qualified",
862
880
/// e.g. `<Vec<T> as SomeTrait>::SomeType`.
863
881
ExprPath ( Option < QSelf > , Path ) ,
864
882
@@ -878,13 +896,15 @@ pub enum Expr_ {
878
896
ExprMac ( Mac ) ,
879
897
880
898
/// A struct literal expression.
899
+ ///
881
900
/// For example, `Foo {x: 1, y: 2}`, or
882
- /// `Foo {x: 1, .. base}`, where `base` is the `Option<Expr>`
901
+ /// `Foo {x: 1, .. base}`, where `base` is the `Option<Expr>`.
883
902
ExprStruct ( Path , Vec < Field > , Option < P < Expr > > ) ,
884
903
885
904
/// A vector literal constructed from one repeated element.
905
+ ///
886
906
/// For example, `[1u8; 5]`. The first expression is the element
887
- /// to be repeated; the second is the number of times to repeat it
907
+ /// to be repeated; the second is the number of times to repeat it.
888
908
ExprRepeat ( P < Expr > , P < Expr > ) ,
889
909
890
910
/// No-op: used solely so we can pretty-print faithfully
@@ -1092,6 +1112,7 @@ pub type Mac = Spanned<Mac_>;
1092
1112
/// Represents a macro invocation. The Path indicates which macro
1093
1113
/// is being invoked, and the vector of token-trees contains the source
1094
1114
/// of the macro invocation.
1115
+ ///
1095
1116
/// There's only one flavor, now, so this could presumably be simplified.
1096
1117
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
1097
1118
pub enum Mac_ {
@@ -1105,6 +1126,7 @@ pub enum StrStyle {
1105
1126
/// A regular string, like `"foo"`
1106
1127
CookedStr ,
1107
1128
/// A raw string, like `r##"foo"##`
1129
+ ///
1108
1130
/// The uint is the number of `#` symbols used
1109
1131
RawStr ( usize )
1110
1132
}
@@ -1459,7 +1481,7 @@ impl Arg {
1459
1481
}
1460
1482
}
1461
1483
1462
- /// represents the header (not the body) of a function declaration
1484
+ /// Represents the header (not the body) of a function declaration
1463
1485
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
1464
1486
pub struct FnDecl {
1465
1487
pub inputs : Vec < Arg > ,
@@ -1505,7 +1527,9 @@ pub enum FunctionRetTy {
1505
1527
/// Functions with return type `!`that always
1506
1528
/// raise an error or exit (i.e. never return to the caller)
1507
1529
NoReturn ( Span ) ,
1508
- /// Return type is not specified. Functions default to `()` and
1530
+ /// Return type is not specified.
1531
+ ///
1532
+ /// Functions default to `()` and
1509
1533
/// closures default to inference. Span points to where return
1510
1534
/// type would be inserted.
1511
1535
DefaultReturn ( Span ) ,
@@ -1645,6 +1669,7 @@ pub struct Attribute_ {
1645
1669
}
1646
1670
1647
1671
/// TraitRef's appear in impls.
1672
+ ///
1648
1673
/// resolve maps each TraitRef's ref_id to its defining trait; that's all
1649
1674
/// that the ref_id is for. The impl_id maps to the "self type" of this impl.
1650
1675
/// If this impl is an ItemImpl, the impl_id is redundant (it could be the
@@ -1745,6 +1770,7 @@ pub struct Item {
1745
1770
#[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable , Hash , Debug ) ]
1746
1771
pub enum Item_ {
1747
1772
/// An`extern crate` item, with optional original crate name,
1773
+ ///
1748
1774
/// e.g. `extern crate foo` or `extern crate "foo-bar" as foo`
1749
1775
ItemExternCrate ( Option < ( InternedString , StrStyle ) > ) ,
1750
1776
/// A `use` or `pub use` item
@@ -1773,6 +1799,7 @@ pub enum Item_ {
1773
1799
Vec < P < TraitItem > > ) ,
1774
1800
1775
1801
// Default trait implementations
1802
+ ///
1776
1803
// `impl Trait for .. {}`
1777
1804
ItemDefaultImpl ( Unsafety , TraitRef ) ,
1778
1805
/// An implementation, eg `impl<A> Trait for Foo { .. }`
0 commit comments