Skip to content

Commit f416284

Browse files
committed
---
yaml --- r: 146797 b: refs/heads/try2 c: 9a4c8da h: refs/heads/master i: 146795: 4c58140 v: v3
1 parent 714ed18 commit f416284

File tree

5 files changed

+25
-1
lines changed

5 files changed

+25
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b3ff24adaa8c7f9c48c525f284526c23ffd33fcb
8+
refs/heads/try2: 9a4c8da5015d8f08310dd2123959761fea84d0f6
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/pat_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: @Pat) -> bool {
7070
}
7171
}
7272

73+
/// Call `it` on every "binding" in a pattern, e.g., on `a` in
74+
/// `match foo() { Some(a) => (), None => () }`
7375
pub fn pat_bindings(dm: resolve::DefMap,
7476
pat: @Pat,
7577
it: |BindingMode, NodeId, Span, &Path|) {

branches/try2/src/librustc/middle/ty.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ pub enum AutoRef {
259259

260260
pub type ctxt = @ctxt_;
261261

262+
/// The data structure to keep track of all the information that typechecker
263+
/// generates so that so that it can be reused and doesn't have to be redone
264+
/// later on.
262265
struct ctxt_ {
263266
diag: @mut syntax::diagnostic::span_handler,
264267
interner: @mut HashMap<intern_key, ~t_box_>,
@@ -296,6 +299,8 @@ struct ctxt_ {
296299
trait_refs: @mut HashMap<NodeId, @TraitRef>,
297300
trait_defs: @mut HashMap<DefId, @TraitDef>,
298301

302+
/// Despite its name, `items` does not only map NodeId to an item but
303+
/// also to expr/stmt/local/arg/etc
299304
items: ast_map::map,
300305
intrinsic_defs: @mut HashMap<ast::DefId, t>,
301306
freevars: freevars::freevar_map,

branches/try2/src/libsyntax/ast.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ pub struct DefId {
173173
node: NodeId,
174174
}
175175

176+
/// Item definitions in the currently-compiled crate would have the CrateNum
177+
/// LOCAL_CRATE in their DefId.
176178
pub static LOCAL_CRATE: CrateNum = 0;
177179
pub static CRATE_NODE_ID: NodeId = 0;
178180

@@ -244,6 +246,10 @@ pub enum Def {
244246
@Def, // closed over def
245247
NodeId, // expr node that creates the closure
246248
NodeId), // id for the block/body of the closure expr
249+
250+
/// Note that if it's a tuple struct's definition, the node id
251+
/// of the DefId refers to the struct_def.ctor_id (whereas normally it
252+
/// refers to the item definition's id).
247253
DefStruct(DefId),
248254
DefTyParamBinder(NodeId), /* struct, impl or trait with ty params */
249255
DefRegion(NodeId),
@@ -451,6 +457,7 @@ pub enum Stmt_ {
451457

452458
// FIXME (pending discussion of #1697, #2178...): local should really be
453459
// a refinement on pat.
460+
/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`
454461
#[deriving(Eq, Encodable, Decodable,IterBytes)]
455462
pub struct Local {
456463
ty: Ty,
@@ -553,6 +560,10 @@ pub enum Expr_ {
553560
ExprAssignOp(NodeId, BinOp, @Expr, @Expr),
554561
ExprField(@Expr, Ident, ~[Ty]),
555562
ExprIndex(NodeId, @Expr, @Expr),
563+
564+
/// Expression that looks like a "name". For example,
565+
/// `std::vec::from_elem::<uint>` is an ExprPath that's the "name" part
566+
/// of a function call.
556567
ExprPath(Path),
557568

558569
/// The special identifier `self`.

branches/try2/src/libsyntax/ast_map.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,18 @@ pub enum ast_node {
111111
node_trait_method(@trait_method, DefId /* trait did */,
112112
@path /* path to the trait */),
113113
node_method(@method, DefId /* impl did */, @path /* path to the impl */),
114+
115+
/// node_variant represents a variant of an enum, e.g., for
116+
/// `enum A { B, C, D }`, there would be a node_item for `A`, and a
117+
/// node_variant item for each of `B`, `C`, and `D`.
114118
node_variant(variant, @item, @path),
115119
node_expr(@Expr),
116120
node_stmt(@Stmt),
117121
node_arg(@Pat),
118122
node_local(Ident),
119123
node_block(Block),
124+
125+
/// node_struct_ctor represents a tuple struct.
120126
node_struct_ctor(@struct_def, @item, @path),
121127
node_callee_scope(@Expr)
122128
}

0 commit comments

Comments
 (0)