diff options
| author | bors <bors@rust-lang.org> | 2013-10-01 15:06:25 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-01 15:06:25 -0700 |
| commit | fe4e7478c5b89994795292db2cea2f944c0f1013 (patch) | |
| tree | 38c10a5e9826d0c5b8daf62539992b57797f1f72 /src/libsyntax | |
| parent | 08b510c351e990d835511f45a28f2f29c12ee545 (diff) | |
| parent | 76d92c547288d5b9a39789868465bb83e0bcead2 (diff) | |
| download | rust-fe4e7478c5b89994795292db2cea2f944c0f1013.tar.gz rust-fe4e7478c5b89994795292db2cea2f944c0f1013.zip | |
auto merge of #9560 : pcwalton/rust/xc-tuple-structs, r=pcwalton
r? @thestinger
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_map.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ast_util.rs | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 105d222926e..b3d5e03331c 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -403,9 +403,9 @@ pub fn map_decoded_item(diag: @mut span_handler, diag: diag, }; - // methods get added to the AST map when their impl is visited. Since we + // Methods get added to the AST map when their impl is visited. Since we // don't decode and instantiate the impl, but just the method, we have to - // add it to the table now: + // add it to the table now. Likewise with foreign items. match *ii { ii_item(*) => {} // fallthrough ii_foreign(i) => { diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 12ad7111f7f..d3a01401fdb 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -590,6 +590,17 @@ impl Visitor<()> for IdVisitor { self.operation.visit_id(struct_field.node.id); visit::walk_struct_field(self, struct_field, env) } + + fn visit_struct_def(&mut self, + struct_def: @struct_def, + ident: ast::Ident, + generics: &ast::Generics, + id: NodeId, + _: ()) { + self.operation.visit_id(id); + struct_def.ctor_id.map(|&ctor_id| self.operation.visit_id(ctor_id)); + visit::walk_struct_def(self, struct_def, ident, generics, id, ()); + } } pub fn visit_ids_for_inlined_item(item: &inlined_item, |
