diff --git a/src/librustc_trans/save/dump_csv.rs b/src/librustc_trans/save/dump_csv.rs index e88b3980737ab075eccb761660b7475502c37cba..cf033ff08060ef841f5b3b111ea0231c40851bbf 100644 --- a/src/librustc_trans/save/dump_csv.rs +++ b/src/librustc_trans/save/dump_csv.rs @@ -886,18 +886,14 @@ fn process_struct_lit(&mut self, fn process_method_call(&mut self, ex: &ast::Expr, args: &Vec
>) {
- let method_call = ty::MethodCall::expr(ex.id);
- let method_id = self.tcx.tables.borrow().method_map[&method_call].def_id;
- let (def_id, decl_id) = match self.tcx.impl_or_trait_item(method_id).container() {
- ty::ImplContainer(_) => (Some(method_id), None),
- ty::TraitContainer(_) => (None, Some(method_id))
- };
- let sub_span = self.span.sub_span_for_meth_name(ex.span);
- self.fmt.meth_call_str(ex.span,
- sub_span,
- def_id,
- decl_id,
- self.cur_scope);
+ if let Some(call_data) = self.save_ctxt.get_expr_data(ex) {
+ down_cast_data!(call_data, MethodCallData, self, ex.span);
+ self.fmt.meth_call_str(ex.span,
+ Some(call_data.span),
+ call_data.ref_id,
+ call_data.decl_id,
+ call_data.scope);
+ }
// walk receiver and args
visit::walk_exprs(self, &args);
diff --git a/src/librustc_trans/save/mod.rs b/src/librustc_trans/save/mod.rs
index 9d66e99df3057fd82265ab4f1ca9694812be2b8d..5d080924e50dfe001981169c71cc622dc0359846 100644
--- a/src/librustc_trans/save/mod.rs
+++ b/src/librustc_trans/save/mod.rs
@@ -61,6 +61,8 @@ pub enum Data {
VariableRefData(VariableRefData),
/// Data for a reference to a type or trait.
TypeRefData(TypeRefData),
+ /// Data about a method call.
+ MethodCallData(MethodCallData),
}
/// Data for all kinds of functions and methods.
@@ -137,6 +139,16 @@ pub struct TypeRefData {
pub ref_id: DefId,
}
+/// Data about a method call.
+#[derive(Debug)]
+pub struct MethodCallData {
+ pub span: Span,
+ pub scope: NodeId,
+ pub ref_id: Option