]> git.lizzy.rs Git - rust.git/commitdiff
Make node_id_to_str print more useful info in some cases. Closes #2410.
authorMichael Sullivan <sully@msully.net>
Mon, 29 Jul 2013 20:44:53 +0000 (13:44 -0700)
committerMichael Sullivan <sully@msully.net>
Mon, 5 Aug 2013 17:33:55 +0000 (10:33 -0700)
src/libsyntax/ast_map.rs

index 5cba22a8e2375a69426df537a04133e23d1e645d..6b4da9671a9636a02641804fc2a0cb3e23672125 100644 (file)
@@ -466,11 +466,11 @@ pub fn node_id_to_str(map: map, id: NodeId, itr: @ident_interner) -> ~str {
       Some(&node_local(ident)) => {
         fmt!("local (id=%?, name=%s)", id, itr.get(ident.name))
       }
-      Some(&node_block(_)) => {
-        fmt!("block")
+      Some(&node_block(ref block)) => {
+        fmt!("block %s (id=%?)", pprust::block_to_str(block, itr), id)
       }
-      Some(&node_struct_ctor(*)) => {
-        fmt!("struct_ctor")
+      Some(&node_struct_ctor(_, _, path)) => {
+        fmt!("struct_ctor %s (id=%?)", path_to_str(*path, itr), id)
       }
     }
 }