about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-08-31 18:45:37 +0200
committerMarijn Haverbeke <marijnh@gmail.com>2011-09-01 16:32:38 +0200
commit2d1dec78e7fd2fa0a569f797d147d5940e81f3d0 (patch)
treefe35c14dcd9c29ed3bee30fe2c11453eacd0e36f /src/comp/syntax
parent34ae491ca9f7ad7549fa0d767f7452055df875d8 (diff)
downloadrust-2d1dec78e7fd2fa0a569f797d147d5940e81f3d0.tar.gz
rust-2d1dec78e7fd2fa0a569f797d147d5940e81f3d0.zip
Move mutability checking into its own pass.
Having it in the alias pass was slightly more efficient (finding
expression roots has to be done in both passes), but further muddled
up the already complex alias checker.

Also factors out some duplication in the mutability-checking code.
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/ast_util.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/comp/syntax/ast_util.rs b/src/comp/syntax/ast_util.rs
index 7744e03fe01..2bad0d1c403 100644
--- a/src/comp/syntax/ast_util.rs
+++ b/src/comp/syntax/ast_util.rs
@@ -46,7 +46,7 @@ fn def_id_of_def(d: def) -> def_id {
     }
 }
 
-type pat_id_map = std::map::hashmap<istr, ast::node_id>;
+type pat_id_map = std::map::hashmap<istr, node_id>;
 
 // This is used because same-named variables in alternative patterns need to
 // use the node_id of their namesake in the first pattern.
@@ -142,7 +142,7 @@ fn ty_mach_to_str(tm: ty_mach) -> istr {
 
 fn is_exported(i: ident, m: _mod) -> bool {
     let nonlocal = true;
-    for it: @ast::item in m.items {
+    for it: @item in m.items {
         if it.ident == i { nonlocal = false; }
         alt it.node {
           item_tag(variants, _) {
@@ -155,9 +155,9 @@ fn is_exported(i: ident, m: _mod) -> bool {
         if !nonlocal { break; }
     }
     let count = 0u;
-    for vi: @ast::view_item in m.view_items {
+    for vi: @view_item in m.view_items {
         alt vi.node {
-          ast::view_item_export(ids, _) {
+          view_item_export(ids, _) {
             for id in ids { if istr::eq(i, id) { ret true; } }
             count += 1u;
           }
@@ -202,7 +202,7 @@ fn obj_field_from_anon_obj_field(f: &anon_obj_field) -> obj_field {
 
 // This is a convenience function to transfor ternary expressions to if
 // expressions so that they can be treated the same
-fn ternary_to_if(e: &@expr) -> @ast::expr {
+fn ternary_to_if(e: &@expr) -> @expr {
     alt e.node {
       expr_ternary(cond, then, els) {
         let then_blk = block_from_expr(then);