]> git.lizzy.rs Git - rust.git/commitdiff
save-analysis: fix declid of methods
authorNick Cameron <ncameron@mozilla.com>
Thu, 15 Jan 2015 03:53:29 +0000 (16:53 +1300)
committerNick Cameron <ncameron@mozilla.com>
Thu, 15 Jan 2015 03:53:29 +0000 (16:53 +1300)
src/librustc_trans/save/mod.rs

index 2cfe7940bbb585886088568d562ccb586619adde..9d8d70b48464ed7bf9082a9dc747e90d9eab5467 100644 (file)
@@ -278,7 +278,7 @@ fn process_method(&mut self, method: &ast::Method) {
         // The qualname for a method is the trait name or name of the struct in an impl in
         // which the method is declared in followed by the method's name.
         let mut qualname = match ty::impl_of_method(&self.analysis.ty_cx,
-                                                ast_util::local_def(method.id)) {
+                                                    ast_util::local_def(method.id)) {
             Some(impl_id) => match self.analysis.ty_cx.map.get(impl_id.node) {
                 NodeItem(item) => {
                     scope_id = item.id;
@@ -349,7 +349,7 @@ fn process_method(&mut self, method: &ast::Method) {
             .and_then(|def_id| {
                 if match def_id {
                     ty::MethodTraitItemId(def_id) => {
-                        method.id != 0 && def_id.node == 0
+                        def_id.node != 0 && def_id != ast_util::local_def(method.id)
                     }
                     ty::TypeTraitItemId(_) => false,
                 } {