]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_save_analysis/lib.rs
Add a sig module to save-analysis
[rust.git] / src / librustc_save_analysis / lib.rs
index 5a8acf9abe1d015115a178758e5d479edca497c6..655901aa8591cc9bba79574aea9678dbbefdce32 100644 (file)
@@ -44,6 +44,7 @@
 pub mod external_data;
 #[macro_use]
 pub mod span_utils;
+mod sig;
 
 use rustc::hir;
 use rustc::hir::def::Def;
@@ -564,8 +565,7 @@ pub fn get_expr_data(&self, expr: &ast::Expr) -> Option<Data> {
                 }
             }
             ast::ExprKind::MethodCall(..) => {
-                let method_call = ty::MethodCall::expr(expr.id);
-                let method_id = self.tables.method_map[&method_call].def_id;
+                let method_id = self.tables.type_dependent_defs[&expr.id].def_id();
                 let (def_id, decl_id) = match self.tcx.associated_item(method_id).container {
                     ty::ImplContainer(_) => (Some(method_id), None),
                     ty::TraitContainer(_) => (None, Some(method_id)),
@@ -618,7 +618,7 @@ pub fn get_path_def(&self, id: NodeId) -> Def {
                             if let ty::TyProjection(proj) = ty.sty {
                                 for item in self.tcx.associated_items(proj.trait_ref.def_id) {
                                     if item.kind == ty::AssociatedKind::Type {
-                                        if item.name == proj.item_name {
+                                        if item.name == proj.item_name(self.tcx) {
                                             return Def::AssociatedTy(item.def_id);
                                         }
                                     }
@@ -828,7 +828,7 @@ fn make_signature(decl: &ast::FnDecl, generics: &ast::Generics) -> String {
     if !generics.lifetimes.is_empty() || !generics.ty_params.is_empty() {
         sig.push('<');
         sig.push_str(&generics.lifetimes.iter()
-                              .map(|l| l.lifetime.name.to_string())
+                              .map(|l| l.lifetime.ident.name.to_string())
                               .collect::<Vec<_>>()
                               .join(", "));
         if !generics.lifetimes.is_empty() {