@@ -413,11 +413,11 @@ impl WherePredicate {
413413#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
414414pub struct WhereBoundPredicate {
415415 pub span : Span ,
416- /// Any generics from a `for` binding
416+ /// Any generics from a `for` binding.
417417 pub bound_generic_params : Vec < GenericParam > ,
418- /// The type being bounded
418+ /// The type being bounded.
419419 pub bounded_ty : P < Ty > ,
420- /// Trait and lifetime bounds (`Clone+ Send+ 'static`)
420+ /// Trait and lifetime bounds (`Clone + Send + 'static`).
421421 pub bounds : GenericBounds ,
422422}
423423
@@ -495,15 +495,15 @@ pub enum MetaItemKind {
495495 NameValue ( Lit ) ,
496496}
497497
498- /// A Block (`{ .. }`).
498+ /// A block (`{ .. }`).
499499///
500500/// E.g., `{ .. }` as in `fn foo() { .. }`.
501501#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
502502pub struct Block {
503- /// Statements in a block
503+ /// The statements in the block.
504504 pub stmts : Vec < Stmt > ,
505505 pub id : NodeId ,
506- /// Distinguishes between `unsafe { ... }` and `{ ... }`
506+ /// Distinguishes between `unsafe { ... }` and `{ ... }`.
507507 pub rules : BlockCheckMode ,
508508 pub span : Span ,
509509}
@@ -908,11 +908,11 @@ pub enum MacStmtStyle {
908908/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`.
909909#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
910910pub struct Local {
911+ pub id : NodeId ,
911912 pub pat : P < Pat > ,
912913 pub ty : Option < P < Ty > > ,
913914 /// Initializer expression to set the value, if any.
914915 pub init : Option < P < Expr > > ,
915- pub id : NodeId ,
916916 pub span : Span ,
917917 pub attrs : ThinVec < Attribute > ,
918918}
@@ -970,7 +970,7 @@ pub struct AnonConst {
970970 pub value : P < Expr > ,
971971}
972972
973- /// An expression
973+ /// An expression.
974974#[ derive( Clone , RustcEncodable , RustcDecodable ) ]
975975pub struct Expr {
976976 pub id : NodeId ,
@@ -984,26 +984,26 @@ pub struct Expr {
984984static_assert_size ! ( Expr , 96 ) ;
985985
986986impl Expr {
987- /// Whether this expression would be valid somewhere that expects a value; for example, an `if`
988- /// condition.
987+ /// Returns `true` if this expression would be valid somewhere that expects a value;
988+ /// for example, an `if` condition.
989989 pub fn returns ( & self ) -> bool {
990990 if let ExprKind :: Block ( ref block, _) = self . node {
991991 match block. stmts . last ( ) . map ( |last_stmt| & last_stmt. node ) {
992- // implicit return
992+ // Implicit return
993993 Some ( & StmtKind :: Expr ( _) ) => true ,
994994 Some ( & StmtKind :: Semi ( ref expr) ) => {
995995 if let ExprKind :: Ret ( _) = expr. node {
996- // last statement is explicit return
996+ // Last statement is explicit return.
997997 true
998998 } else {
999999 false
10001000 }
10011001 }
1002- // This is a block that doesn't end in either an implicit or explicit return
1002+ // This is a block that doesn't end in either an implicit or explicit return.
10031003 _ => false ,
10041004 }
10051005 } else {
1006- // This is not a block, it is a value
1006+ // This is not a block, it is a value.
10071007 true
10081008 }
10091009 }
@@ -2307,57 +2307,57 @@ impl Default for FnHeader {
23072307
23082308#[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
23092309pub enum ItemKind {
2310- /// An `extern crate` item, with optional *original* crate name if the crate was renamed.
2310+ /// An `extern crate` item, with the optional *original* crate name if the crate was renamed.
23112311 ///
23122312 /// E.g., `extern crate foo` or `extern crate foo_bar as foo`.
23132313 ExternCrate ( Option < Name > ) ,
2314- /// A use declaration (`use` or `pub use`) item .
2314+ /// A use declaration item (`use`) .
23152315 ///
23162316 /// E.g., `use foo;`, `use foo::bar;` or `use foo::bar as FooBar;`.
23172317 Use ( P < UseTree > ) ,
2318- /// A static item (`static` or `pub static` ).
2318+ /// A static item (`static`).
23192319 ///
23202320 /// E.g., `static FOO: i32 = 42;` or `static FOO: &'static str = "bar";`.
23212321 Static ( P < Ty > , Mutability , P < Expr > ) ,
2322- /// A constant item (`const` or `pub const` ).
2322+ /// A constant item (`const`).
23232323 ///
23242324 /// E.g., `const FOO: i32 = 42;`.
23252325 Const ( P < Ty > , P < Expr > ) ,
2326- /// A function declaration (`fn` or `pub fn` ).
2326+ /// A function declaration (`fn`).
23272327 ///
23282328 /// E.g., `fn foo(bar: usize) -> usize { .. }`.
23292329 Fn ( P < FnDecl > , FnHeader , Generics , P < Block > ) ,
2330- /// A module declaration (`mod` or `pub mod` ).
2330+ /// A module declaration (`mod`).
23312331 ///
23322332 /// E.g., `mod foo;` or `mod foo { .. }`.
23332333 Mod ( Mod ) ,
2334- /// An external module (`extern` or `pub extern` ).
2334+ /// An external module (`extern`).
23352335 ///
23362336 /// E.g., `extern {}` or `extern "C" {}`.
23372337 ForeignMod ( ForeignMod ) ,
23382338 /// Module-level inline assembly (from `global_asm!()`).
23392339 GlobalAsm ( P < GlobalAsm > ) ,
2340- /// A type alias (`type` or `pub type` ).
2340+ /// A type alias (`type`).
23412341 ///
23422342 /// E.g., `type Foo = Bar<u8>;`.
23432343 TyAlias ( P < Ty > , Generics ) ,
23442344 /// An opaque `impl Trait` type alias.
23452345 ///
23462346 /// E.g., `type Foo = impl Bar + Boo;`.
23472347 OpaqueTy ( GenericBounds , Generics ) ,
2348- /// An enum definition (`enum` or `pub enum` ).
2348+ /// An enum definition (`enum`).
23492349 ///
23502350 /// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
23512351 Enum ( EnumDef , Generics ) ,
2352- /// A struct definition (`struct` or `pub struct` ).
2352+ /// A struct definition (`struct`).
23532353 ///
23542354 /// E.g., `struct Foo<A> { x: A }`.
23552355 Struct ( VariantData , Generics ) ,
2356- /// A union definition (`union` or `pub union` ).
2356+ /// A union definition (`union`).
23572357 ///
23582358 /// E.g., `union Foo<A, B> { x: A, y: B }`.
23592359 Union ( VariantData , Generics ) ,
2360- /// A Trait declaration (`trait` or `pub trait`).
2360+ /// A trait declaration (`trait`).
23612361 ///
23622362 /// E.g., `trait Foo { .. }`, `trait Foo<T> { .. }` or `auto trait Foo {}`.
23632363 Trait ( IsAuto , Unsafety , Generics , GenericBounds , Vec < TraitItem > ) ,
0 commit comments