diff options
| author | Graydon Hoare <[email protected]> | 2010-11-29 12:13:38 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-29 12:13:38 -0800 |
| commit | 20b11c832cee3f4ed7a7abaa0284c40d32dbd262 (patch) | |
| tree | ac79e3a31d10bc101d7b2ab874877e0bce73442e | |
| parent | Copy args to allocas, change llargs lookups to 'in mem'. Un-XFAIL tup.rs. (diff) | |
| download | rust-20b11c832cee3f4ed7a7abaa0284c40d32dbd262.tar.xz rust-20b11c832cee3f4ed7a7abaa0284c40d32dbd262.zip | |
Add mut field to typeck.ty.
| -rw-r--r-- | src/comp/middle/typeck.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/comp/middle/typeck.rs b/src/comp/middle/typeck.rs index 84421a4c..a0aec16f 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)); |