From 451de33f7b33205301e01a5ef8bb55a6a6e790b3 Mon Sep 17 00:00:00 2001 From: Michael Sullivan Date: Tue, 20 Aug 2013 10:15:36 -0700 Subject: [PATCH] Add `self` to the ast_map for provided methods. Closes #8010. --- src/libsyntax/ast_map.rs | 16 +++++++++++----- 1 file 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); + } + } } } _ => {}