}
fn path_to_str(p: &ast::Path) -> String {
- use syntax::parse::token;
-
let mut s = String::new();
let mut first = true;
for i in p.segments.iter().map(|x| token::get_ident(x.identifier)) {
match p.node {
PatWild => "_".to_string(),
PatWildMulti => "..".to_string(),
- PatIdent(_, ref p, _) => path_to_str(p),
+ PatIdent(_, ref p, _) => token::get_ident(p.node).get().to_string(),
PatEnum(ref p, _) => path_to_str(p),
PatStruct(..) => fail!("tried to get argument name from pat_struct, \
which is not allowed in function arguments"),