From 35175f015ff878d49e3b5562fe3a7addcef25cfc Mon Sep 17 00:00:00 2001 From: John Clements Date: Wed, 2 Jul 2014 23:17:10 -0700 Subject: [PATCH] comments only --- src/libsyntax/ast.rs | 4 +++- src/libsyntax/ext/expand.rs | 6 +++--- src/libsyntax/fold.rs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index e2a74ba4dfc9..ce1302c8db87 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -190,6 +190,8 @@ pub struct TyParam { pub span: Span } +/// Represents lifetimes and type parameters attached to a declaration +/// of a function, enum, trait, etc. #[deriving(Clone, PartialEq, Eq, Encodable, Decodable, Hash)] pub struct Generics { pub lifetimes: Vec, @@ -288,7 +290,7 @@ pub enum Pat_ { PatWild, PatWildMulti, // A PatIdent may either be a new bound variable, - // or a nullary enum (in which case the second field + // or a nullary enum (in which case the third field // is None). // In the nullary enum case, the parser can't determine // which it is. The resolver determines this, and diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index 31226a620ea8..55bc5e3c3036 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -841,9 +841,9 @@ fn expand_pat(p: Gc, fld: &mut MacroExpander) -> Gc { } } -// a tree-folder that applies every rename in its (mutable) list -// to every identifier, including both bindings and varrefs -// (and lots of things that will turn out to be neither) +/// A tree-folder that applies every rename in its (mutable) list +/// to every identifier, including both bindings and varrefs +/// (and lots of things that will turn out to be neither) pub struct IdentRenamer<'a> { renames: &'a mtwt::RenameList, } diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index f9d7078da3dc..04e6612daf1f 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -794,7 +794,7 @@ pub fn noop_fold_pat(p: Gc, folder: &mut T) -> Gc { PatIdent(binding_mode, ref pth1, ref sub) => { PatIdent(binding_mode, Spanned{span: folder.new_span(pth1.span), - node: folder.fold_ident(pth1.node)}, + node: folder.fold_ident(pth1.node)}, sub.map(|x| folder.fold_pat(x))) } PatLit(e) => PatLit(folder.fold_expr(e)),