diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-09-26 21:53:40 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-10-01 14:24:34 -0700 |
| commit | 76d92c547288d5b9a39789868465bb83e0bcead2 (patch) | |
| tree | 0411918795a03ddad994268e8b30b5d9983cfbac /src/libsyntax | |
| parent | c8cdabc32fc7c6a5c3b01ef24340bc2f4b1ae359 (diff) | |
| download | rust-76d92c547288d5b9a39789868465bb83e0bcead2.tar.gz rust-76d92c547288d5b9a39789868465bb83e0bcead2.zip | |
librustc: Inline cross-crate tuple struct constructors
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 f93fc1e81da..f42eb89456d 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, |
