about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast_map.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs
index 2cc8cb23f2e..9c90a422c53 100644
--- a/src/libsyntax/ast_map.rs
+++ b/src/libsyntax/ast_map.rs
@@ -299,7 +299,20 @@ fn node_id_to_str(map: map, id: node_id, itr: ident_interner) -> ~str {
         fmt!{"unknown node (id=%d)", id}
       }
       some(node_item(item, path)) => {
-        fmt!{"item %s (id=%?)", path_ident_to_str(*path, item.ident, itr), id}
+        let path_str = path_ident_to_str(*path, item.ident, itr);
+        let item_str = match item.node {
+          item_const(*) => ~"const",
+          item_fn(*) => ~"fn",
+          item_mod(*) => ~"mod",
+          item_foreign_mod(*) => ~"foreign mod",
+          item_ty(*) => ~"ty",
+          item_enum(*) => ~"enum",
+          item_class(*) => ~"class",
+          item_trait(*) => ~"trait",
+          item_impl(*) => ~"impl",
+          item_mac(*) => ~"macro"
+        };
+        fmt!("%s %s (id=%?)", item_str, path_str, id)
       }
       some(node_foreign_item(item, abi, path)) => {
         fmt!{"foreign item %s with abi %? (id=%?)",