about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2010-11-29 12:13:38 -0800
committerGraydon Hoare <graydon@mozilla.com>2010-11-29 12:13:38 -0800
commit20b11c832cee3f4ed7a7abaa0284c40d32dbd262 (patch)
treeac79e3a31d10bc101d7b2ab874877e0bce73442e
parent7be7c23b6b5ead25529814ccdbc0101d6b6d7683 (diff)
Add mut field to typeck.ty.
-rw-r--r--src/comp/middle/typeck.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs
index 84421a4c1cd..a0aec16f654 100644
--- a/src/comp/middle/typeck.rs
+++ b/src/comp/middle/typeck.rs
@@ -28,7 +28,7 @@ type arg = rec(ast.mode mode, @ty ty);
 
 // NB: If you change this, you'll probably want to change the corresponding
 // AST structure in front/ast.rs as well.
-type ty = rec(sty struct, option.t[str] cname);
+type ty = rec(sty struct, bool mut, option.t[str] cname);
 tag sty {
     ty_nil;
     ty_bool;
@@ -257,7 +257,7 @@ fn ast_ty_to_ty(ty_getter getter, &@ast.ty ast_ty) -> @ty {
         }
     }
 
-    ret @rec(struct=sty, cname=cname);
+    ret @rec(struct=sty, mut=false, cname=cname);
 }
 
 // A convenience function to use a crate_ctxt to resolve names for
@@ -522,7 +522,7 @@ fn type_is_signed(@ty t) -> bool {
 }
 
 fn plain_ty(&sty st) -> @ty {
-    ret @rec(struct=st, cname=none[str]);
+    ret @rec(struct=st, mut=false, cname=none[str]);
 }
 
 fn ann_to_type(&ast.ann ann) -> @ty {
@@ -1075,7 +1075,7 @@ fn check_expr(&fn_ctxt fcx, @ast.expr expr) -> @ast.expr {
         }
 
         case (ast.expr_name(?name, ?defopt, _)) {
-            auto t = @rec(struct=ty_nil, cname=none[str]);
+            auto t = plain_ty(ty_nil);
             alt (option.get[ast.def](defopt)) {
                 case (ast.def_arg(?id)) {
                     check (fcx.locals.contains_key(id));