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:
parent
20b8509594
commit
3ebf7b42bd
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user