Skip to content

Commit bcf62e7

Browse files
committed
Make node_id_to_str print more useful info in some cases. Closes #2410.
1 parent d89ff7e commit bcf62e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/libsyntax/ast_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,11 @@ pub fn node_id_to_str(map: map, id: NodeId, itr: @ident_interner) -> ~str {
466466
Some(&node_local(ident)) => {
467467
fmt!("local (id=%?, name=%s)", id, itr.get(ident.name))
468468
}
469-
Some(&node_block(_)) => {
470-
fmt!("block")
469+
Some(&node_block(ref block)) => {
470+
fmt!("block %s (id=%?)", pprust::block_to_str(block, itr), id)
471471
}
472-
Some(&node_struct_ctor(*)) => {
473-
fmt!("struct_ctor")
472+
Some(&node_struct_ctor(_, _, path)) => {
473+
fmt!("struct_ctor %s (id=%?)", path_to_str(*path, itr), id)
474474
}
475475
}
476476
}

0 commit comments

Comments
 (0)