diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-08-03 15:02:01 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-08-03 15:02:53 -0700 |
| commit | b65dd9d0908ba75ee4cf128058858aea87e4508a (patch) | |
| tree | 794ee6f47d188314a2b0256fd954cbcf8219331c /src/libsyntax/ast_map.rs | |
| parent | a805a1fb37443601819604954510cb312a724fe9 (diff) | |
rustc: Parse, serialize, and deserialize trait inheritance
Diffstat (limited to 'src/libsyntax/ast_map.rs')
| -rw-r--r-- | src/libsyntax/ast_map.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index acd20951328..c8daae0982d 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -231,7 +231,15 @@ fn map_item(i: @item, cx: ctx, v: vt) { // only need to handle methods do vec::iter(ms) |m| { map_method(d_id, p, m, cx); } } - item_trait(tps, methods) { + item_trait(tps, traits, methods) { + // Map trait refs to their parent classes. This is + // so we can find the self_ty + for traits.each |p| { + cx.map.insert(p.ref_id, node_item(i, item_path)); + // This is so we can look up the right things when + // encoding/decoding + cx.map.insert(p.impl_id, node_item(i, item_path)); + } for methods.each |tm| { let id = ast_util::trait_method_to_ty_method(tm).id; let d_id = ast_util::local_def(i.id); |
