rustc: Assert that the parser doesn't assign node id 0

It is reserved for indicating the crate, but doesn't exist in the AST
This commit is contained in:
Brian Anderson 2012-01-18 18:52:09 -08:00
parent 20b8509594
commit 3ebf7b42bd

View File

@ -31,6 +31,8 @@ type parse_sess = @{
fn next_node_id(sess: parse_sess) -> node_id {
let rv = sess.next_id;
sess.next_id += 1;
// ID 0 is reserved for the crate and doesn't actually exist in the AST
assert rv != 0;
ret rv;
}