rustc: fix de-@rooting fallout

This commit is contained in:
Flavio Percoco
2014-04-23 18:16:23 +02:00
parent 6e53cfa61e
commit 2e358672f8
3 changed files with 14 additions and 13 deletions
-1
View File
@@ -25,7 +25,6 @@
use std::ops::{BitOr, BitAnd};
use std::rc::Rc;
use std::strbuf::StrBuf;
use collections::HashMap;
use syntax::ast;
use syntax::ast_map;
use syntax::ast_util;
+4 -4
View File
@@ -640,7 +640,7 @@ pub fn create_function_debug_context(cx: &CrateContext,
}
}
}
ast_map::NodeMethod(method) => {
ast_map::NodeMethod(ref method) => {
(method.ident,
method.decl,
&method.generics,
@@ -667,9 +667,9 @@ pub fn create_function_debug_context(cx: &CrateContext,
"create_function_debug_context: expected an expr_fn_block here")
}
}
ast_map::NodeTraitMethod(trait_method) => {
match *trait_method {
ast::Provided(method) => {
ast_map::NodeTraitMethod(ref trait_method) => {
match **trait_method {
ast::Provided(ref method) => {
(method.ident,
method.decl,
&method.generics,
@@ -674,14 +674,16 @@ fn give_suggestion(&self, same_regions: &[SameRegions]) {
let parent = self.tcx.map.get_parent(scope_id);
let parent_node = self.tcx.map.find(parent);
let node_inner = match parent_node {
Some(node) => match node {
ast_map::NodeItem(item) => match item.node {
ast::ItemFn(ref fn_decl, ref pur, _, ref gen, _) => {
Some((fn_decl, gen, *pur, item.ident, None, item.span))
},
_ => None
},
ast_map::NodeMethod(m) => {
Some(ref node) => match *node {
ast_map::NodeItem(ref item) => {
match item.node {
ast::ItemFn(ref fn_decl, ref pur, _, ref gen, _) => {
Some((fn_decl, gen, *pur, item.ident, None, item.span))
},
_ => None
}
}
ast_map::NodeMethod(ref m) => {
Some((&m.decl, &m.generics, m.fn_style,
m.ident, Some(m.explicit_self.node), m.span))
},