diff options
| author | bors <bors@rust-lang.org> | 2013-08-22 17:21:29 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-22 17:21:29 -0700 |
| commit | 23bfa600a0f91f1ea62ea3f3783c358a7cb7da45 (patch) | |
| tree | 5cbc5e327157d1fc25e40c5445b59dbe83850636 /src/libsyntax | |
| parent | f858452391c63bfbf46678c4ea9fd584adf1c28e (diff) | |
| parent | 7b08b2c838c440d03e3e01f090e648e14ebfa083 (diff) | |
| download | rust-23bfa600a0f91f1ea62ea3f3783c358a7cb7da45.tar.gz rust-23bfa600a0f91f1ea62ea3f3783c358a7cb7da45.zip | |
auto merge of #8659 : msullivan/rust/default-methods, r=alexcrichton
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_map.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs index 6c3fb82965d..9c9d19ba46b 100644 --- a/src/libsyntax/ast_map.rs +++ b/src/libsyntax/ast_map.rs @@ -238,12 +238,18 @@ impl Visitor<()> for Ctx { self.map.insert(p.ref_id, node_item(i, item_path)); } for tm in methods.iter() { - let id = ast_util::trait_method_to_ty_method(tm).id; + let ext = { self.extend(i.ident) }; let d_id = ast_util::local_def(i.id); - self.map.insert(id, - node_trait_method(@(*tm).clone(), - d_id, - item_path)); + match *tm { + required(ref m) => { + let entry = + node_trait_method(@(*tm).clone(), d_id, ext); + self.map.insert(m.id, entry); + } + provided(m) => { + self.map_method(d_id, ext, m, true); + } + } } } _ => {} |
