about summary refs log tree commit diff
path: root/src/comp/syntax/parse
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-01-18 18:52:09 -0800
committerBrian Anderson <banderson@mozilla.com>2012-01-18 19:59:24 -0800
commit3ebf7b42bd930de73f376dd1b3f2060e00b0fe6d (patch)
tree6931b9030867b7c0258e6302ead93b4a71a23bac /src/comp/syntax/parse
parent20b8509594a8acd5dd68d7acb6da94029deed7fb (diff)
downloadrust-3ebf7b42bd930de73f376dd1b3f2060e00b0fe6d.tar.gz
rust-3ebf7b42bd930de73f376dd1b3f2060e00b0fe6d.zip
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
Diffstat (limited to 'src/comp/syntax/parse')
-rw-r--r--src/comp/syntax/parse/parser.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 4a4b22c3e12..174851c4fcb 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -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;
 }