]> git.lizzy.rs Git - rust.git/commitdiff
Bulk-edit mutable -> mut.
authorGraydon Hoare <graydon@mozilla.com>
Tue, 27 Mar 2012 01:35:18 +0000 (18:35 -0700)
committerGraydon Hoare <graydon@mozilla.com>
Tue, 27 Mar 2012 01:35:18 +0000 (18:35 -0700)
160 files changed:
doc/keywords.txt
doc/lib/codemirror-rust.js
doc/rust.md
doc/tutorial.md
src/cargo/cargo.rs
src/fuzzer/fuzzer.rs
src/fuzzer/rand_util.rs
src/libcore/future.rs
src/libcore/io.rs
src/libcore/libc.rs
src/libcore/option.rs
src/libcore/os.rs
src/libcore/ptr.rs
src/libcore/run.rs
src/libcore/task.rs
src/libcore/vec.rs
src/libstd/bitv.rs
src/libstd/c_vec.rs
src/libstd/deque.rs
src/libstd/ebml.rs
src/libstd/getopts.rs
src/libstd/json.rs
src/libstd/list.rs
src/libstd/map.rs
src/libstd/rope.rs
src/libstd/sha1.rs
src/libstd/smallintmap.rs
src/libstd/sort.rs
src/libstd/test.rs
src/libstd/treemap.rs
src/libstd/ufind.rs
src/rustc/driver/diagnostic.rs
src/rustc/driver/driver.rs
src/rustc/driver/session.rs
src/rustc/front/attr.rs
src/rustc/front/test.rs
src/rustc/metadata/astencode.rs
src/rustc/metadata/creader.rs
src/rustc/metadata/cstore.rs
src/rustc/metadata/encoder.rs
src/rustc/metadata/tydecode.rs
src/rustc/middle/alias.rs
src/rustc/middle/ast_map.rs
src/rustc/middle/block_use.rs
src/rustc/middle/check_alt.rs
src/rustc/middle/freevars.rs
src/rustc/middle/infer.rs
src/rustc/middle/last_use.rs
src/rustc/middle/mutbl.rs
src/rustc/middle/resolve.rs
src/rustc/middle/trans/alt.rs
src/rustc/middle/trans/base.rs
src/rustc/middle/trans/common.rs
src/rustc/middle/trans/debuginfo.rs
src/rustc/middle/trans/shape.rs
src/rustc/middle/trans/type_use.rs
src/rustc/middle/tstate/annotate.rs
src/rustc/middle/tstate/auxiliary.rs
src/rustc/middle/tstate/collect_locals.rs
src/rustc/middle/ty.rs
src/rustc/middle/typeck.rs
src/rustc/syntax/ast.rs
src/rustc/syntax/codemap.rs
src/rustc/syntax/ext/base.rs
src/rustc/syntax/ext/qquote.rs
src/rustc/syntax/ext/simplext.rs
src/rustc/syntax/fold.rs
src/rustc/syntax/parse/lexer.rs
src/rustc/syntax/parse/parser.rs
src/rustc/syntax/print/pp.rs
src/rustc/syntax/print/pprust.rs
src/rustc/syntax/util/interner.rs
src/rustc/util/common.rs
src/rustdoc/astsrv.rs
src/rustdoc/attr_parser.rs
src/rustdoc/parse.rs
src/rustdoc/path_pass.rs
src/rustdoc/rustdoc [new file with mode: 0755]
src/test/auxiliary/cci_class.rs
src/test/auxiliary/cci_class_2.rs
src/test/auxiliary/cci_class_3.rs
src/test/auxiliary/cci_class_4.rs
src/test/auxiliary/cci_class_5.rs
src/test/bench/shootout-fasta.rs
src/test/bench/shootout-nbody.rs
src/test/bench/shootout-spectralnorm.rs
src/test/bench/sudoku.rs
src/test/bench/task-perf-word-count.rs
src/test/compile-fail/assign-to-method.rs
src/test/compile-fail/mutable-huh-variance-box.rs
src/test/compile-fail/mutable-huh-variance-deep.rs
src/test/compile-fail/mutable-huh-variance-ptr.rs
src/test/compile-fail/mutable-huh-variance-rec.rs
src/test/compile-fail/mutable-huh-variance-unique.rs
src/test/compile-fail/mutable-huh-variance-vec1.rs
src/test/compile-fail/mutable-huh-variance-vec2.rs
src/test/compile-fail/mutable-huh-variance-vec3.rs
src/test/compile-fail/pinned-deep-copy.rs
src/test/compile-fail/private-class-field.rs
src/test/compile-fail/private-method.rs
src/test/compile-fail/unique-mut.rs
src/test/compile-fail/unique-vec-res.rs
src/test/compile-fail/unsafe-alias-2.rs
src/test/compile-fail/unsafe-alias.rs
src/test/compile-fail/unsafe-alt.rs
src/test/compile-fail/unsafe-for.rs
src/test/compile-fail/unsafe-mutable-alias.rs
src/test/pretty/block-disambig.rs
src/test/run-fail/unwind-misc-1.rs
src/test/run-pass/alignment-gep-tup-like-2.rs
src/test/run-pass/alloca-from-derived-tydesc.rs
src/test/run-pass/alt-implicit-copy-unique.rs
src/test/run-pass/alt-implicit-copy.rs
src/test/run-pass/argument-passing.rs
src/test/run-pass/class-methods.rs
src/test/run-pass/classes-simple-method.rs
src/test/run-pass/classes-simple.rs
src/test/run-pass/classes.rs
src/test/run-pass/cycle-collection.rs
src/test/run-pass/cycle-collection2.rs
src/test/run-pass/cycle-collection4.rs
src/test/run-pass/cycle-collection5.rs
src/test/run-pass/deref-lval.rs
src/test/run-pass/empty-mutable-vec.rs
src/test/run-pass/expr-copy.rs
src/test/run-pass/exterior.rs
src/test/run-pass/for-implicit-copy.rs
src/test/run-pass/foreach-nested.rs
src/test/run-pass/iface-cast.rs
src/test/run-pass/init-res-into-things.rs
src/test/run-pass/issue-979.rs
src/test/run-pass/issue-980.rs
src/test/run-pass/lambda-infer-unresolved.rs
src/test/run-pass/log-linearized.rs
src/test/run-pass/maybe-mutable.rs
src/test/run-pass/mlist-cycle.rs
src/test/run-pass/mutable-huh-variance-vec1.rs
src/test/run-pass/mutable-huh-variance-vec2.rs
src/test/run-pass/mutable-vec-drop.rs
src/test/run-pass/nested-patterns.rs
src/test/run-pass/private-class-field.rs
src/test/run-pass/private-method.rs
src/test/run-pass/qquote.rs
src/test/run-pass/regions-simple.rs
src/test/run-pass/resource-assign-is-not-copy.rs
src/test/run-pass/resource-destruct.rs
src/test/run-pass/resource-generic.rs
src/test/run-pass/resource-in-struct.rs
src/test/run-pass/sendfn-deep-copy.rs
src/test/run-pass/swap-2.rs
src/test/run-pass/task-killjoin-rsrc.rs
src/test/run-pass/uniq-cc-generic.rs
src/test/run-pass/uniq-cc.rs
src/test/run-pass/unique-assign-copy.rs
src/test/run-pass/unique-decl-init-copy.rs
src/test/run-pass/unique-in-vec-copy.rs
src/test/run-pass/unique-mutable.rs
src/test/run-pass/unique-pinned-nocopy-2.rs
src/test/run-pass/weird-exprs.rs
src/test/run-pass/writealias.rs

index 7300c7c5eee17d5743352f93981cc1365b6c2cb1..2b4a389e2f82040a615f0a07bb72d02a813c5dd4 100644 (file)
@@ -8,7 +8,7 @@ else export
 f32 f64 fail false float fn for
 i16 i32 i64 i8 if import in int
 let log loop
-mod mutable
+mod mut
 native note
 obj  
 prove pure
index fb2f1c5a91a60bd82a63fafc5e02e1ddcdef0186..626351e236c446061850bff0f1d16cfaf6ca5395 100644 (file)
@@ -218,14 +218,14 @@ CodeMirror.defineMode("rust", function() {
       if (content == "|") return cont(blockvars, poplex, pushlex("}", "block"), block);
       if (content == "||") return cont(poplex, pushlex("}", "block"), block);
     }
-    if (content == "mutable" || (content.match(/^\w+$/) && cx.stream.peek() == ":"
+    if (content == "mut" || (content.match(/^\w+$/) && cx.stream.peek() == ":"
                                  && !cx.stream.match("::", false)))
       return pass(record_of(expression));
     return pass(block);
   }
   function record_of(comb) {
     function ro(type) {
-      if (content == "mutable" || content == "with") {cx.marked = "keyword"; return cont(ro);}
+      if (content == "mut" || content == "with") {cx.marked = "keyword"; return cont(ro);}
       if (content.match(/^\w*$/)) {cx.marked = "variable"; return cont(ro);}
       if (type == ":") return cont(comb, ro);
       if (type == "}") return cont();
@@ -317,7 +317,7 @@ CodeMirror.defineMode("rust", function() {
   }
   function rtype(type) {
     if (type == "name") {cx.marked = "variable-3"; return cont(rtypemaybeparam); }
-    if (content == "mutable") {cx.marked = "keyword"; return cont(rtype);}
+    if (content == "mut") {cx.marked = "keyword"; return cont(rtype);}
     if (type == "atom") return cont(rtypemaybeparam);
     if (type == "op" || type == "obj") return cont(rtype);
     if (type == "fn") return cont(fntype);
index 74cb13446209722251e6af21aa80010e78bb72a8..224f4c099f60d749eb4274ebfb7de84196887cf3 100644 (file)
@@ -217,7 +217,7 @@ else enum export
 fail false fn for
 if iface impl import
 let log loop
-mod mutable
+mod mut
 native
 pure
 resource ret
@@ -1527,13 +1527,13 @@ rec_expr : '{' ident ':' expr
 A _[record](#record-types) expression_ is one or more comma-separated
 name-value pairs enclosed by braces. A fieldname can be any identifier
 (including keywords), and is separated from its value expression by a
-colon. To indicate that a field is mutable, the `mutable` keyword is
+colon. To indicate that a field is mutable, the `mut` keyword is
 written before its name.
 
 ~~~~
 {x: 10f, y: 20f};
 {name: "Joe", age: 35u, score: 100_000};
-{ident: "X", mutable count: 0u};
+{ident: "X", mut count: 0u};
 ~~~~
 
 The order of the fields in a record expression is significant, and
@@ -1586,19 +1586,19 @@ expression on the left of the dot.
 ### Vector expressions
 
 ~~~~~~~~{.ebnf .gram}
-vec_expr : '[' "mutable" ? [ expr [ ',' expr ] * ] ? ']'
+vec_expr : '[' "mut" ? [ expr [ ',' expr ] * ] ? ']'
 ~~~~~~~~
 
 A _[vector](#vector-types) expression_ is written by enclosing zero or
 more comma-separated expressions of uniform type in square brackets.
-The keyword `mutable` can be written after the opening bracket to
+The keyword `mut` can be written after the opening bracket to
 indicate that the elements of the resulting vector may be mutated.
 When no mutability is specified, the vector is immutable.
 
 ~~~~
 [1, 2, 3, 4];
 ["a", "b", "c", "d"];
-[mutable 0u8, 0u8, 0u8, 0u8];
+[mut 0u8, 0u8, 0u8, 0u8];
 ~~~~
 
 ### Index expressions
@@ -1622,7 +1622,7 @@ task in a _failing state_.
 # task::run(builder) {||
 
 [1, 2, 3, 4][0];
-[mutable 'x', 'y'][1] = 'z';
+[mut 'x', 'y'][1] = 'z';
 ["a", "b"][10]; // fails
 
 # }
@@ -1904,11 +1904,11 @@ argument to a function to be copied and passed by value.
 An example of a copy expression:
 
 ~~~~
-fn mutate(vec: [mutable int]) {
+fn mutate(vec: [mut int]) {
    vec[0] = 10;
 }
 
-let v = [mutable 1,2,3];
+let v = [mut 1,2,3];
 
 mutate(copy v);   // Pass a copy
 
index e264458af7322f44dfc36a5677874ff32fade94d..d2a9e0cecc3ff4a1e5730800474abebb0e92886e 100644 (file)
@@ -366,7 +366,7 @@ more detail later on (the `T`s here stand for any other type):
 `[T]`
   : Vector type.
 
-`[mutable T]`
+`[mut T]`
   : Mutable vector type.
 
 `(T1, T2)`
@@ -994,10 +994,10 @@ Fields that you want to mutate must be explicitly marked as such. For
 example...
 
 ~~~~
-type stack = {content: [int], mutable head: uint};
+type stack = {content: [int], mut head: uint};
 ~~~~
 
-With such a type, you can do `mystack.head += 1u`. If `mutable` were
+With such a type, you can do `mystack.head += 1u`. If `mut` were
 omitted from the type, such an assignment would result in a type
 error.
 
@@ -1240,12 +1240,12 @@ become the sole owner of the box.
 
 ### Mutability
 
-All pointer types have a mutable variant, written `@mutable TYPE` or
-`~mutable TYPE`. Given such a pointer, you can write to its contents
+All pointer types have a mutable variant, written `@mut TYPE` or
+`~mut TYPE`. Given such a pointer, you can write to its contents
 by combining the dereference operator with a mutating action.
 
 ~~~~
-fn increase_contents(pt: @mutable int) {
+fn increase_contents(pt: @mut int) {
     *pt += 1;
 }
 ~~~~
@@ -1268,9 +1268,9 @@ if myvec[1] { io::println("boom"); }
 ~~~~
 
 By default, vectors are immutable—you can not replace their elements.
-The type written as `[mutable TYPE]` is a vector with mutable
-elements. Mutable vector literals are written `[mutable]` (empty) or
-`[mutable 1, 2, 3]` (with elements).
+The type written as `[mut TYPE]` is a vector with mutable
+elements. Mutable vector literals are written `[mut]` (empty) or
+`[mut 1, 2, 3]` (with elements).
 
 The `+` operator means concatenation when applied to vector types.
 Growing a vector in Rust is not as inefficient as it looks :
@@ -1398,7 +1398,7 @@ to pessimistically assume a value will get mutated, even though it is
 not sure.
 
 ~~~~
-fn for_each(v: [mutable @int], iter: fn(@int)) {
+fn for_each(v: [mut @int], iter: fn(@int)) {
    for elt in v { iter(elt); }
 }
 ~~~~
@@ -1413,15 +1413,15 @@ reference count is considered cheap enough to not warn about it).
 ## The copy operator
 
 If the `for_each` function given above were to take a vector of
-`{mutable a: int}` instead of `@int`, it would not be able to
+`{mut a: int}` instead of `@int`, it would not be able to
 implicitly copy, since if the `iter` function changes a copy of a
 mutable record, the changes won't be visible in the record itself. If
 we *do* want to allow copies there, we have to explicitly allow it
 with the `copy` operator:
 
 ~~~~
-type mutrec = {mutable x: int};
-fn for_each(v: [mutable mutrec], iter: fn(mutrec)) {
+type mutrec = {mut x: int};
+fn for_each(v: [mut mutrec], iter: fn(mutrec)) {
    for elt in v { iter(copy elt); }
 }
 ~~~~
@@ -1529,7 +1529,7 @@ Generic `type` and `enum` declarations follow the same pattern:
 ~~~~
 type circular_buf<T> = {start: uint,
                         end: uint,
-                        buf: [mutable T]};
+                        buf: [mut T]};
 
 enum option<T> { some(T), none }
 ~~~~
@@ -2315,14 +2315,14 @@ microsecond-resolution timer.
 
 ~~~~
 use std;
-type timeval = {mutable tv_sec: uint,
-                mutable tv_usec: uint};
+type timeval = {mut tv_sec: uint,
+                mut tv_usec: uint};
 #[nolink]
 native mod libc {
     fn gettimeofday(tv: *timeval, tz: *()) -> i32;
 }
 fn unix_time_in_microseconds() -> u64 unsafe {
-    let x = {mutable tv_sec: 0u, mutable tv_usec: 0u};
+    let x = {mut tv_sec: 0u, mut tv_usec: 0u};
     libc::gettimeofday(ptr::addr_of(x), ptr::null());
     ret (x.tv_sec as u64) * 1000_000_u64 + (x.tv_usec as u64);
 }
index 478b8f449e0512256e271247ddb14c2b3a42e6b4..51edc90589acd86a86717410f4014978e213ce2a 100644 (file)
@@ -43,7 +43,7 @@ enum _src {
     sig: option<str>,
     key: option<str>,
     keyfp: option<str>,
-    mutable packages: [package]
+    mut packages: [package]
 };
 
 type cargo = {
@@ -117,10 +117,10 @@ fn load_pkg(filename: str) -> option<pkg> {
     let handler = diagnostic::mk_handler(none);
     let sess = @{
         cm: cm,
-        mutable next_id: 1,
+        mut next_id: 1,
         span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-        mutable chpos: 0u,
-        mutable byte_pos: 0u
+        mut chpos: 0u,
+        mut byte_pos: 0u
     };
     let c = parser::parse_crate_from_crate_file(filename, [], sess);
 
@@ -214,7 +214,7 @@ fn parse_source(name: str, j: json::json) -> source {
                 _ { none }
             };
             ret { name: name, url: url, sig: sig, key: key, keyfp: keyfp,
-                  mutable packages: [] };
+                  mut packages: [] };
         }
         _ { fail "Needed dict value in source."; }
     };
index f3ea25ef2d5f7cfea30e8965087cfc37b8070d6c..bbac28ec8449b5993b5e5765549154915057260e 100644 (file)
@@ -119,7 +119,7 @@ fn safe_to_steal_ty(t: @ast::ty, tm: test_mode) -> bool {
 
 // Not type-parameterized: https://github.com/mozilla/rust/issues/898 (FIXED)
 fn stash_expr_if(c: fn@(@ast::expr, test_mode)->bool,
-                 es: @mutable [ast::expr],
+                 es: @mut [ast::expr],
                  e: @ast::expr,
                  tm: test_mode) {
     if c(e, tm) {
@@ -128,7 +128,7 @@ fn stash_expr_if(c: fn@(@ast::expr, test_mode)->bool,
 }
 
 fn stash_ty_if(c: fn@(@ast::ty, test_mode)->bool,
-               es: @mutable [ast::ty],
+               es: @mut [ast::ty],
                e: @ast::ty,
                tm: test_mode) {
     if c(e, tm) {
@@ -139,8 +139,8 @@ fn stash_ty_if(c: fn@(@ast::ty, test_mode)->bool,
 type stolen_stuff = {exprs: [ast::expr], tys: [ast::ty]};
 
 fn steal(crate: ast::crate, tm: test_mode) -> stolen_stuff {
-    let exprs = @mutable [];
-    let tys = @mutable [];
+    let exprs = @mut [];
+    let tys = @mut [];
     let v = visit::mk_simple_visitor(@{
         visit_expr: bind stash_expr_if(safe_to_steal_expr, exprs, _, tm),
         visit_ty: bind stash_ty_if(safe_to_steal_ty, tys, _, tm)
@@ -176,8 +176,8 @@ fn safe_to_replace_ty(t: ast::ty_, _tm: test_mode) -> bool {
 // Replace the |i|th expr (in fold order) of |crate| with |newexpr|.
 fn replace_expr_in_crate(crate: ast::crate, i: uint, newexpr: ast::expr, tm: test_mode) ->
    ast::crate {
-    let j: @mutable uint = @mutable 0u;
-    fn fold_expr_rep(j_: @mutable uint, i_: uint, newexpr_: ast::expr_,
+    let j: @mut uint = @mut 0u;
+    fn fold_expr_rep(j_: @mut uint, i_: uint, newexpr_: ast::expr_,
                      original: ast::expr_, fld: fold::ast_fold, tm_: test_mode) ->
        ast::expr_ {
         *j_ += 1u;
@@ -199,8 +199,8 @@ fn fold_expr_rep(j_: @mutable uint, i_: uint, newexpr_: ast::expr_,
 // Replace the |i|th ty (in fold order) of |crate| with |newty|.
 fn replace_ty_in_crate(crate: ast::crate, i: uint, newty: ast::ty, tm: test_mode) ->
    ast::crate {
-    let j: @mutable uint = @mutable 0u;
-    fn fold_ty_rep(j_: @mutable uint, i_: uint, newty_: ast::ty_,
+    let j: @mut uint = @mut 0u;
+    fn fold_ty_rep(j_: @mut uint, i_: uint, newty_: ast::ty_,
                      original: ast::ty_, fld: fold::ast_fold, tm_: test_mode) ->
        ast::ty_ {
         *j_ += 1u;
@@ -403,10 +403,10 @@ fn parse_and_print(code: @str) -> str {
     let handler = diagnostic::mk_handler(none);
     let sess = @{
         cm: cm,
-        mutable next_id: 1,
+        mut next_id: 1,
         span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-        mutable chpos: 0u,
-        mutable byte_pos: 0u
+        mut chpos: 0u,
+        mut byte_pos: 0u
     };
     write_file(filename, *code);
     let crate = parser::parse_crate_from_source_str(
@@ -422,8 +422,8 @@ fn parse_and_print(code: @str) -> str {
 }
 
 fn has_raw_pointers(c: ast::crate) -> bool {
-    let has_rp = @mutable false;
-    fn visit_ty(flag: @mutable bool, t: @ast::ty) {
+    let has_rp = @mut false;
+    fn visit_ty(flag: @mut bool, t: @ast::ty) {
         alt t.node {
           ast::ty_ptr(_) { *flag = true; }
           _ { }
@@ -549,10 +549,10 @@ fn check_variants(files: [str], cx: context) {
         let handler = diagnostic::mk_handler(none);
         let sess = @{
             cm: cm,
-            mutable next_id: 1,
+            mut next_id: 1,
             span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-            mutable chpos: 0u,
-            mutable byte_pos: 0u
+            mut chpos: 0u,
+            mut byte_pos: 0u
         };
         let crate =
             parser::parse_crate_from_source_str(
index 6e518363125db776f747fd89b7712bb35c478351..a20e7651627b80b56516f1d112bd2c3f22d93f1b 100644 (file)
@@ -12,7 +12,7 @@
 fn unlikely(r : rand::rng, n : uint) -> bool { under(r, n) == 0u }
 
 // shuffle a vec in place
-fn shuffle<T>(r : rand::rng, &v : [mutable T]) {
+fn shuffle<T>(r : rand::rng, &v : [mut T]) {
     let i = vec::len(v);
     while i >= 2u {
         // Loop invariant: elements with index >= i have been locked in place.
@@ -73,7 +73,7 @@ fn main()
     log(error, choice(r, [10, 20, 30]));
     log(error, if unlikely(r, 5u) { "unlikely" } else { "likely" });
 
-    let a = [mutable 1, 2, 3];
+    let a = [mut 1, 2, 3];
     shuffle(r, a);
     log(error, a);
 
index 702da24a75f243713c0f054ef90490237dd5b9ef..ba11138d9ae536bede8c2640727c27017640d685 100644 (file)
@@ -24,7 +24,7 @@
 
 #[doc = "The future type"]
 enum future<A> = {
-    mutable v: either<@A, fn@() -> A>
+    mut v: either<@A, fn@() -> A>
 };
 
 #[doc = "Methods on the `future` type"]
@@ -52,7 +52,7 @@ fn from_value<A>(+val: A) -> future<A> {
     "];
 
     future({
-        mutable v: either::left(@val)
+        mut v: either::left(@val)
     })
 }
 
@@ -79,7 +79,7 @@ fn from_fn<A>(f: fn@() -> A) -> future<A> {
     "];
 
     future({
-        mutable v: either::right(f)
+        mut v: either::right(f)
     })
 }
 
index 292ef86641d03d2b655e304e100fd79bd9c2e657..4525fade3b83a53aac4c1ed89e9bf9952060340f 100644 (file)
@@ -174,10 +174,10 @@ fn convert_whence(whence: seek_style) -> i32 {
 
 impl of reader for *libc::FILE {
     fn read_bytes(len: uint) -> [u8] unsafe {
-        let mut buf : [mutable u8] = [mutable];
+        let mut buf : [mut u8] = [mut];
         vec::reserve(buf, len);
         vec::as_mut_buf(buf) {|b|
-            let read = libc::fread(b as *mutable c_void, 1u,
+            let read = libc::fread(b as *mut c_void, 1u,
                                    len, self);
             vec::unsafe::set_len(buf, read);
         }
@@ -237,7 +237,7 @@ fn file_reader(path: str) -> result<reader, str> {
 // Byte buffer readers
 
 // TODO: const u8, but this fails with rustboot.
-type byte_buf = {buf: [u8], mutable pos: uint, len: uint};
+type byte_buf = {buf: [u8], mut pos: uint, len: uint};
 
 impl of reader for byte_buf {
     fn read_bytes(len: uint) -> [u8] {
@@ -268,7 +268,7 @@ fn bytes_reader(bytes: [u8]) -> reader {
 }
 
 fn bytes_reader_between(bytes: [u8], start: uint, end: uint) -> reader {
-    {buf: bytes, mutable pos: start, len: end} as reader
+    {buf: bytes, mut pos: start, len: end} as reader
 }
 
 fn with_bytes_reader<t>(bytes: [u8], f: fn(reader) -> t) -> t {
@@ -514,14 +514,14 @@ fn stderr() -> writer { fd_writer(libc::STDERR_FILENO as c_int, false) }
 fn print(s: str) { stdout().write_str(s); }
 fn println(s: str) { stdout().write_line(s); }
 
-type mem_buffer = @{mutable buf: [mutable u8],
-                    mutable pos: uint};
+type mem_buffer = @{mut buf: [mut u8],
+                    mut pos: uint};
 
 impl of writer for mem_buffer {
     fn write(v: [const u8]) {
         // Fast path.
         if self.pos == vec::len(self.buf) {
-            for b: u8 in v { self.buf += [mutable b]; }
+            for b: u8 in v { self.buf += [mut b]; }
             self.pos += vec::len(v);
             ret;
         }
@@ -531,7 +531,7 @@ fn write(v: [const u8]) {
         while vpos < vlen {
             let b = v[vpos];
             if self.pos == vec::len(self.buf) {
-                self.buf += [mutable b];
+                self.buf += [mut b];
             } else { self.buf[self.pos] = b; }
             self.pos += 1u;
             vpos += 1u;
@@ -547,7 +547,7 @@ fn flush() -> int { 0 }
 }
 
 fn mem_buffer() -> mem_buffer {
-    @{mutable buf: [mutable], mutable pos: 0u}
+    @{mut buf: [mut], mut pos: 0u}
 }
 fn mem_buffer_writer(b: mem_buffer) -> writer { b as writer }
 fn mem_buffer_buf(b: mem_buffer) -> [u8] { vec::from_mut(b.buf) }
index 912ab3a7429d6dbde5731ce46076cba655c9b524..9b04de10f481f725d3375323f87176865ac8a7fe 100644 (file)
@@ -346,17 +346,17 @@ mod extra {
                 type LPCWSTR = *WCHAR;
                 type LPCSTR = *CHAR;
 
-                type LPWSTR = *mutable WCHAR;
-                type LPSTR = *mutable CHAR;
+                type LPWSTR = *mut WCHAR;
+                type LPSTR = *mut CHAR;
 
                 // Not really, but opaque to us.
                 type LPSECURITY_ATTRIBUTES = LPVOID;
 
-                type LPVOID = *mutable c_void;
-                type LPWORD = *mutable WORD;
+                type LPVOID = *mut c_void;
+                type LPWORD = *mut WORD;
 
                 type LRESULT = LONG_PTR;
-                type PBOOL = *mutable BOOL;
+                type PBOOL = *mut BOOL;
                 type WCHAR = wchar_t;
                 type WORD = u16;
             }
@@ -757,7 +757,7 @@ fn setvbuf(stream: *FILE, buffer: *c_char,
             fn setbuf(stream: *FILE, buf: *c_char);
             // Omitted: printf and scanf variants.
             fn fgetc(stream: *FILE) -> c_int;
-            fn fgets(buf: *mutable c_char, n: c_int,
+            fn fgets(buf: *mut c_char, n: c_int,
                      stream: *FILE) -> *c_char;
             fn fputc(c: c_int, stream: *FILE) -> c_int;
             fn fputs(s: *c_char, stream: *FILE) -> *c_char;
@@ -769,7 +769,7 @@ fn fgets(buf: *mutable c_char, n: c_int,
             // Omitted: putc, putchar (might be macros).
             fn puts(s: *c_char) -> c_int;
             fn ungetc(c: c_int, stream: *FILE) -> c_int;
-            fn fread(ptr: *mutable c_void, size: size_t,
+            fn fread(ptr: *mut c_void, size: size_t,
                      nobj: size_t, stream: *FILE) -> size_t;
             fn fwrite(ptr: *c_void, size: size_t,
                       nobj: size_t, stream: *FILE) -> size_t;
@@ -933,11 +933,11 @@ fn execve(prog: *c_char, argv: **c_char,
             fn lseek(fd: c_int, offset: c_long, origin: c_int) -> c_long;
 
             #[link_name = "_pipe"]
-            fn pipe(fds: *mutable c_int, psize: c_uint,
+            fn pipe(fds: *mut c_int, psize: c_uint,
                     textmode: c_int) -> c_int;
 
             #[link_name = "_read"]
-            fn read(fd: c_int, buf: *mutable c_void, count: c_uint) -> c_int;
+            fn read(fd: c_int, buf: *mut c_void, count: c_uint) -> c_int;
 
             #[link_name = "_rmdir"]
             fn rmdir(path: *c_char) -> c_int;
@@ -1013,7 +1013,7 @@ mod posix88 {
             fn getegid() -> gid_t;
             fn geteuid() -> uid_t;
             fn getgid() -> gid_t ;
-            fn getgroups(ngroups_max: c_int, groups: *mutable gid_t) -> c_int;
+            fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int;
             fn getlogin() -> *c_char;
             fn getopt(argc: c_int, argv: **c_char, optstr: *c_char) -> c_int;
             fn getpgrp() -> pid_t;
@@ -1025,8 +1025,8 @@ mod posix88 {
             fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t;
             fn pathconf(path: *c_char, name: c_int) -> c_long;
             fn pause() -> c_int;
-            fn pipe(fds: *mutable c_int) -> c_int;
-            fn read(fd: c_int, buf: *mutable c_void,
+            fn pipe(fds: *mut c_int) -> c_int;
+            fn read(fd: c_int, buf: *mut c_void,
                     count: size_t) -> ssize_t;
             fn rmdir(path: *c_char) -> c_int;
             fn setgid(gid: gid_t) -> c_int;
@@ -1050,7 +1050,7 @@ mod posix01 {
         #[nolink]
         #[abi = "cdecl"]
         native mod unistd {
-            fn readlink(path: *c_char, buf: *mutable c_char,
+            fn readlink(path: *c_char, buf: *mut c_char,
                         bufsz: size_t) -> ssize_t;
 
             fn fsync(fd: c_int) -> c_int;
@@ -1067,7 +1067,7 @@ fn setenv(name: *c_char, val: *c_char,
         #[nolink]
         #[abi = "cdecl"]
         native mod wait {
-            fn waitpid(pid: pid_t, status: *mutable c_int,
+            fn waitpid(pid: pid_t, status: *mut c_int,
                        options: c_int) -> pid_t;
         }
     }
@@ -1096,15 +1096,15 @@ mod posix08 {
     native mod bsd44 {
 
         fn sysctl(name: *c_int, namelen: c_uint,
-                  oldp: *mutable c_void, oldlenp: *mutable size_t,
+                  oldp: *mut c_void, oldlenp: *mut size_t,
                   newp: *c_void, newlen: size_t) -> c_int;
 
         fn sysctlbyname(name: *c_char,
-                        oldp: *mutable c_void, oldlenp: *mutable size_t,
+                        oldp: *mut c_void, oldlenp: *mut size_t,
                         newp: *c_void, newlen: size_t) -> c_int;
 
-        fn sysctlnametomib(name: *c_char, mibp: *mutable c_int,
-                           sizep: *mutable size_t) -> c_int;
+        fn sysctlnametomib(name: *c_char, mibp: *mut c_int,
+                           sizep: *mut size_t) -> c_int;
     }
 
 
@@ -1118,8 +1118,8 @@ mod bsd44 {
     #[nolink]
     #[abi = "cdecl"]
     native mod extra {
-        fn _NSGetExecutablePath(buf: *mutable c_char,
-                                bufsize: *mutable u32) -> c_int;
+        fn _NSGetExecutablePath(buf: *mut c_char,
+                                bufsize: *mut u32) -> c_int;
     }
 
     #[cfg(target_os = "freebsd")]
index f2aebc12d330f223cb0f2ee5bb66d99388591259..748683121d5b92c71f90b7a39c102963cefe480c 100644 (file)
@@ -109,10 +109,10 @@ fn test_unwrap_str() {
 
 #[test]
 fn test_unwrap_resource() {
-    resource r(i: @mutable int) {
+    resource r(i: @mut int) {
         *i += 1;
     }
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let x = r(i);
         let opt = some(x);
index b9e290a9bb94bf18e288999ff46516d8a19b38bc..c69da22aa6ff829176501fdbb09dad3b66a6f549 100644 (file)
@@ -61,7 +61,7 @@ fn as_c_charp<T>(s: str, f: fn(*c_char) -> T) -> T {
     str::as_c_str(s) {|b| f(b as *c_char) }
 }
 
-fn fill_charp_buf(f: fn(*mutable c_char, size_t) -> bool)
+fn fill_charp_buf(f: fn(*mut c_char, size_t) -> bool)
     -> option<str> {
     let buf = vec::to_mut(vec::from_elem(tmpbuf_sz, 0u8 as c_char));
     vec::as_mut_buf(buf) { |b|
@@ -77,7 +77,7 @@ fn fill_charp_buf(f: fn(*mutable c_char, size_t) -> bool)
 mod win32 {
     import dword = libc::types::os::arch::extra::DWORD;
 
-    fn fill_utf16_buf_and_decode(f: fn(*mutable u16, dword) -> dword)
+    fn fill_utf16_buf_and_decode(f: fn(*mut u16, dword) -> dword)
         -> option<str> {
 
         // FIXME: remove these when export globs work properly.
@@ -241,8 +241,8 @@ fn waitpid(pid: pid_t) -> c_int {
 #[cfg(target_os = "freebsd")]
 #[cfg(target_os = "macos")]
 fn pipe() -> {in: c_int, out: c_int} {
-    let fds = {mutable in: 0 as c_int,
-               mutable out: 0 as c_int };
+    let fds = {mut in: 0 as c_int,
+               mut out: 0 as c_int };
     assert (libc::pipe(ptr::mut_addr_of(fds.in)) == (0 as c_int));
     ret {in: fds.in, out: fds.out};
 }
@@ -258,8 +258,8 @@ fn pipe() -> {in: c_int, out: c_int} {
     // understand. Here we explicitly make the pipe non-inheritable, which
     // means to pass it to a subprocess they need to be duplicated first, as
     // in rust_run_program.
-    let fds = { mutable in: 0 as c_int,
-               mutable out: 0 as c_int };
+    let fds = { mut in: 0 as c_int,
+               mut out: 0 as c_int };
     let res = libc::pipe(ptr::mut_addr_of(fds.in),
                          1024 as c_uint,
                          (O_BINARY | O_NOINHERIT) as c_int);
@@ -294,7 +294,7 @@ fn load_self() -> option<path> unsafe {
                        KERN_PROC as c_int,
                        KERN_PROC_PATHNAME as c_int, -1 as c_int];
             sysctl(vec::unsafe::to_ptr(mib), vec::len(mib) as c_uint,
-                   buf as *mutable c_void, ptr::mut_addr_of(sz),
+                   buf as *mut c_void, ptr::mut_addr_of(sz),
                    ptr::null(), 0u as size_t) == (0 as c_int)
         }
     }
index cf8f21969f59ce9e229909a728af20b0cb7929c6..a7bcfe5c9a8e0db5307a43110014807f3fc1ebbf 100644 (file)
@@ -28,9 +28,9 @@
 #[inline(always)]
 fn addr_of<T>(val: T) -> *T { rusti::addr_of(val) }
 
-#[doc = "Get an unsafe mutable pointer to a value"]
+#[doc = "Get an unsafe mut pointer to a value"]
 #[inline(always)]
-fn mut_addr_of<T>(val: T) -> *mutable T unsafe {
+fn mut_addr_of<T>(val: T) -> *mut T unsafe {
     unsafe::reinterpret_cast(rusti::addr_of(val))
 }
 
@@ -40,10 +40,10 @@ fn offset<T>(ptr: *T, count: uint) -> *T unsafe {
     (ptr as uint + count * sys::size_of::<T>()) as *T
 }
 
-#[doc = "Calculate the offset from a mutable pointer"]
+#[doc = "Calculate the offset from a mut pointer"]
 #[inline(always)]
-fn mut_offset<T>(ptr: *mutable T, count: uint) -> *mutable T {
-    (ptr as uint + count * sys::size_of::<T>()) as *mutable T
+fn mut_offset<T>(ptr: *mut T, count: uint) -> *mut T {
+    (ptr as uint + count * sys::size_of::<T>()) as *mut T
 }
 
 
@@ -77,16 +77,16 @@ unsafe fn memmove<T>(dst: *T, src: *T, count: uint)  {
 
 #[test]
 fn test() unsafe {
-    type pair = {mutable fst: int, mutable snd: int};
-    let p = {mutable fst: 10, mutable snd: 20};
-    let pptr: *mutable pair = mut_addr_of(p);
-    let iptr: *mutable int = unsafe::reinterpret_cast(pptr);
+    type pair = {mut fst: int, mut snd: int};
+    let p = {mut fst: 10, mut snd: 20};
+    let pptr: *mut pair = mut_addr_of(p);
+    let iptr: *mut int = unsafe::reinterpret_cast(pptr);
     assert (*iptr == 10);;
     *iptr = 30;
     assert (*iptr == 30);
     assert (p.fst == 30);;
 
-    *pptr = {mutable fst: 50, mutable snd: 60};
+    *pptr = {mut fst: 50, mut snd: 60};
     assert (*iptr == 50);
     assert (p.fst == 50);
     assert (p.snd == 60);
index 912b4419f519b90dd3a5628c8fe3d4196a682bbc..e0812b2117dcd1db2d3365bd8c549ef54dd03c83 100644 (file)
@@ -198,10 +198,10 @@ fn start_program(prog: str, args: [str]) -> program {
     libc::close(pipe_err.out);
 
     type prog_repr = {pid: pid_t,
-                      mutable in_fd: c_int,
+                      mut in_fd: c_int,
                       out_file: *libc::FILE,
                       err_file: *libc::FILE,
-                      mutable finished: bool};
+                      mut finished: bool};
 
     fn close_repr_input(r: prog_repr) {
         let invalid_fd = -1i32;
@@ -233,10 +233,10 @@ fn finish() -> int { finish_repr(*self) }
         fn destroy() { destroy_repr(*self); }
     }
     let repr = {pid: pid,
-                mutable in_fd: pipe_input.out,
+                mut in_fd: pipe_input.out,
                 out_file: os::fdopen(pipe_output.in),
                 err_file: os::fdopen(pipe_err.in),
-                mutable finished: false};
+                mut finished: false};
     ret prog_res(repr) as program;
 }
 
index c6dfd326e03df843147edfdd7909412f72762945..dcd784fb2a3278c9a35322d5f9a006ed4420243d 100644 (file)
@@ -157,8 +157,8 @@ enum sched_mode {
 // the run function move them in.
 enum task_builder {
     task_builder_({
-        mutable opts: task_opts,
-        mutable gen_body: fn@(+fn~()) -> fn~(),
+        mut opts: task_opts,
+        mut gen_body: fn@(+fn~()) -> fn~(),
         can_not_copy: option<comm::port<()>>
     })
 }
@@ -187,8 +187,8 @@ fn task_builder() -> task_builder {
     let body_identity = fn@(+body: fn~()) -> fn~() { body };
 
     task_builder_({
-        mutable opts: default_task_opts(),
-        mutable gen_body: body_identity,
+        mut opts: default_task_opts(),
+        mut gen_body: body_identity,
         can_not_copy: none
     })
 }
index c0bd70c270c0d1c43e02476c488a66daaee91632..0f19a6c64ffe1d83542a0cec1cbc1a1a2c306ff7 100644 (file)
@@ -150,15 +150,15 @@ fn from_elem<T: copy>(n_elts: uint, t: T) -> [T] {
     ret v;
 }
 
-#[doc = "Produces a mutable vector from an immutable vector."]
-fn to_mut<T>(+v: [T]) -> [mutable T] unsafe {
+#[doc = "Produces a mut vector from an immutable vector."]
+fn to_mut<T>(+v: [T]) -> [mut T] unsafe {
     let r = ::unsafe::reinterpret_cast(v);
     ::unsafe::forget(v);
     r
 }
 
-#[doc = "Produces an immutable vector from a mutable vector."]
-fn from_mut<T>(+v: [mutable T]) -> [T] unsafe {
+#[doc = "Produces an immutable vector from a mut vector."]
+fn from_mut<T>(+v: [mut T]) -> [T] unsafe {
     let r = ::unsafe::reinterpret_cast(v);
     ::unsafe::forget(v);
     r
@@ -396,7 +396,7 @@ fn grow_fn<T>(&v: [const T], n: uint, op: init_op<T>) {
 of the vector, expands the vector by replicating `initval` to fill the
 intervening space.
 "]
-fn grow_set<T: copy>(&v: [mutable T], index: uint, initval: T, val: T) {
+fn grow_set<T: copy>(&v: [mut T], index: uint, initval: T, val: T) {
     if index >= len(v) { grow(v, index - len(v) + 1u, initval); }
     v[index] = val;
 }
@@ -729,12 +729,12 @@ fn zip<T: copy, U: copy>(v: [const T], u: [const U]) -> [(T, U)] {
 * a - The index of the first element
 * b - The index of the second element
 "]
-fn swap<T>(v: [mutable T], a: uint, b: uint) {
+fn swap<T>(v: [mut T], a: uint, b: uint) {
     v[a] <-> v[b];
 }
 
 #[doc = "Reverse the order of elements in a vector, in place"]
-fn reverse<T>(v: [mutable T]) {
+fn reverse<T>(v: [mut T]) {
     let mut i: uint = 0u;
     let ln = len::<T>(v);
     while i < ln / 2u { v[i] <-> v[ln - i - 1u]; i += 1u; }
@@ -890,8 +890,8 @@ fn as_buf<E,T>(v: [const E], f: fn(*E) -> T) -> T unsafe {
     let buf = unsafe::to_ptr(v); f(buf)
 }
 
-fn as_mut_buf<E,T>(v: [mutable E], f: fn(*mutable E) -> T) -> T unsafe {
-    let buf = unsafe::to_ptr(v) as *mutable E; f(buf)
+fn as_mut_buf<E,T>(v: [mut E], f: fn(*mut E) -> T) -> T unsafe {
+    let buf = unsafe::to_ptr(v) as *mut E; f(buf)
 }
 
 #[doc = "An extension implementation providing a `len` method"]
@@ -905,7 +905,7 @@ fn len() -> uint { len(self) }
 mod unsafe {
     // FIXME: This should have crate visibility
     #[doc = "The internal representation of a vector"]
-    type vec_repr = {mutable fill: uint, mutable alloc: uint, data: u8};
+    type vec_repr = {mut fill: uint, mut alloc: uint, data: u8};
 
     #[doc = "
     Constructs a vector from an unsafe pointer to a buffer
@@ -1212,7 +1212,7 @@ fn test_grow_fn() {
 
     #[test]
     fn test_grow_set() {
-        let mut v = [mutable 1, 2, 3];
+        let mut v = [mut 1, 2, 3];
         grow_set(v, 4u, 4, 5);
         assert (len(v) == 5u);
         assert (v[0] == 1);
@@ -1619,7 +1619,7 @@ fn test_rfind_between() {
 
     #[test]
     fn reverse_and_reversed() {
-        let v: [mutable int] = [mutable 10, 20];
+        let v: [mut int] = [mut 10, 20];
         assert (v[0] == 10);
         assert (v[1] == 20);
         reverse(v);
@@ -1634,13 +1634,13 @@ fn reverse_and_reversed() {
 
         let v4 = reversed::<int>([]);
         assert (v4 == []);
-        let v3: [mutable int] = [mutable];
+        let v3: [mut int] = [mut];
         reverse::<int>(v3);
     }
 
     #[test]
     fn reversed_mut() {
-        let v2 = reversed::<int>([mutable 10, 20]);
+        let v2 = reversed::<int>([mut 10, 20]);
         assert (v2[0] == 20);
         assert (v2[1] == 10);
     }
index 371f45cb7a986296138d407ee26e17e4d285bc79..37df940f6fbd2f3eb9eac1efab95582beb4686d7 100644 (file)
@@ -22,7 +22,7 @@
 //        for the case where nbits <= 32.
 
 #[doc = "The bitvector type"]
-type bitv = @{storage: [mutable uint], nbits: uint};
+type bitv = @{storage: [mut uint], nbits: uint};
 
 const uint_bits: uint = 32u + (1u << 32u >> 27u);
 
index 28ee44690eed764d2b95cdb03ee6722d3bfe688f..ce89f323cdc76da43b47b2c6e6f2401a7c678b9d 100644 (file)
@@ -4,7 +4,7 @@
 It is often desirable to safely interface with memory allocated from C,
 encapsulating the unsafety into allocation and destruction time.  Indeed,
 allocating memory externally is currently the only way to give Rust shared
-mutable state with C programs that keep their own references; vectors are
+mut state with C programs that keep their own references; vectors are
 unsuitable because they could be reallocated or moved at any time, and
 importing C memory into a vector takes a one-time snapshot of the memory.
 
@@ -38,7 +38,7 @@
 truly opaque types, this should be revisited.
 "]
 enum c_vec<T> {
-    c_vec_({ base: *mutable T, len: uint, rsrc: @dtor_res})
+    c_vec_({ base: *mut T, len: uint, rsrc: @dtor_res})
 }
 
 resource dtor_res(dtor: option<fn@()>) {
@@ -60,7 +60,7 @@ enum c_vec<T> {
 * base - A native pointer to a buffer
 * len - The number of elements in the buffer
 "]
-unsafe fn c_vec<T>(base: *mutable T, len: uint) -> c_vec<T> {
+unsafe fn c_vec<T>(base: *mut T, len: uint) -> c_vec<T> {
     ret c_vec_({
         base: base,
         len: len,
@@ -79,7 +79,7 @@ unsafe fn c_vec<T>(base: *mutable T, len: uint) -> c_vec<T> {
 * dtor - A function to run when the value is destructed, useful
          for freeing the buffer, etc.
 "]
-unsafe fn c_vec_with_dtor<T>(base: *mutable T, len: uint, dtor: fn@())
+unsafe fn c_vec_with_dtor<T>(base: *mut T, len: uint, dtor: fn@())
   -> c_vec<T> {
     ret c_vec_({
         base: base,
@@ -122,7 +122,7 @@ fn len<T>(t: c_vec<T>) -> uint {
 }
 
 #[doc = "Returns a pointer to the first element of the vector"]
-unsafe fn ptr<T>(t: c_vec<T>) -> *mutable T {
+unsafe fn ptr<T>(t: c_vec<T>) -> *mut T {
     ret (*t).base;
 }
 
@@ -135,7 +135,7 @@ fn malloc(n: size_t) -> c_vec<u8> {
 
         assert mem as int != 0;
 
-        ret unsafe { c_vec_with_dtor(mem as *mutable u8, n,
+        ret unsafe { c_vec_with_dtor(mem as *mut u8, n,
                                      bind free(mem)) };
     }
 
index 749cefc5ba6c873a3ad6fe23402021cc9600446c..8a894a4b8f3510f431b18cdb5bf60c17fc6cd1ba 100644 (file)
@@ -23,30 +23,30 @@ fn create<T: copy>() -> t<T> {
       * Grow is only called on full elts, so nelts is also len(elts), unlike
       * elsewhere.
       */
-    fn grow<T: copy>(nelts: uint, lo: uint, elts: [mutable cell<T>]) ->
-       [mutable cell<T>] {
+    fn grow<T: copy>(nelts: uint, lo: uint, elts: [mut cell<T>]) ->
+       [mut cell<T>] {
         assert (nelts == vec::len(elts));
-        let mut rv = [mutable];
+        let mut rv = [mut];
 
         let mut i = 0u;
         let nalloc = uint::next_power_of_two(nelts + 1u);
         while i < nalloc {
             if i < nelts {
-                rv += [mutable elts[(lo + i) % nelts]];
-            } else { rv += [mutable none]; }
+                rv += [mut elts[(lo + i) % nelts]];
+            } else { rv += [mut none]; }
             i += 1u;
         }
 
         ret rv;
     }
-    fn get<T: copy>(elts: [mutable cell<T>], i: uint) -> T {
+    fn get<T: copy>(elts: [mut cell<T>], i: uint) -> T {
         ret alt elts[i] { some(t) { t } _ { fail } };
     }
 
-    type repr<T> = {mutable nelts: uint,
-                    mutable lo: uint,
-                    mutable hi: uint,
-                    mutable elts: [mutable cell<T>]};
+    type repr<T> = {mut nelts: uint,
+                    mut lo: uint,
+                    mut hi: uint,
+                    mut elts: [mut cell<T>]};
 
     impl <T: copy> of t<T> for repr<T> {
         fn size() -> uint { ret self.nelts; }
@@ -102,10 +102,10 @@ fn get(i: int) -> T {
     }
 
     let repr: repr<T> = {
-        mutable nelts: 0u,
-        mutable lo: 0u,
-        mutable hi: 0u,
-        mutable elts: vec::to_mut(vec::from_elem(initial_capacity, none))
+        mut nelts: 0u,
+        mut lo: 0u,
+        mut hi: 0u,
+        mut elts: vec::to_mut(vec::from_elem(initial_capacity, none))
     };
     repr as t::<T>
 }
index 40c44da8b4545e6c74144aa9d02dd226797b9475..91a9c244011e81f004f5bca5f2f356eb29932f15 100644 (file)
@@ -149,7 +149,7 @@ fn doc_as_i32(d: doc) -> i32 { doc_as_u32(d) as i32 }
 fn doc_as_i64(d: doc) -> i64 { doc_as_u64(d) as i64 }
 
 // ebml writing
-type writer = {writer: io::writer, mutable size_positions: [uint]};
+type writer = {writer: io::writer, mut size_positions: [uint]};
 
 fn write_sized_vuint(w: io::writer, n: uint, size: uint) {
     let buf: [u8] = alt size {
@@ -178,7 +178,7 @@ fn write_vuint(w: io::writer, n: uint) {
 
 fn writer(w: io::writer) -> writer {
     let size_positions: [uint] = [];
-    ret {writer: w, mutable size_positions: size_positions};
+    ret {writer: w, mut size_positions: size_positions};
 }
 
 // TODO: Provide a function to write the standard ebml header.
@@ -361,11 +361,11 @@ fn emit_tup(_sz: uint, f: fn()) { f() }
     fn emit_tup_elt(_idx: uint, f: fn()) { f() }
 }
 
-type ebml_deserializer = {mutable parent: ebml::doc,
-                          mutable pos: uint};
+type ebml_deserializer = {mut parent: ebml::doc,
+                          mut pos: uint};
 
 fn ebml_deserializer(d: ebml::doc) -> ebml_deserializer {
-    {mutable parent: d, mutable pos: d.start}
+    {mut parent: d, mut pos: d.start}
 }
 
 impl deserializer of serialization::deserializer for ebml_deserializer {
index 91f9c499ce15df45180b231ff31c9805db26d905..3d921fb4d9d3555c404551388c01f3b33f62c2a9 100644 (file)
@@ -114,7 +114,7 @@ enum optval { val(str), given, }
 The result of checking command line arguments. Contains a vector
 of matches and a vector of free strings.
 "]
-type match = {opts: [opt], vals: [mutable [optval]], free: [str]};
+type match = {opts: [opt], vals: [mut [optval]], free: [str]};
 
 fn is_arg(arg: str) -> bool {
     ret str::len(arg) > 1u && arg[0] == '-' as u8;
index 8f7765c4e023eedceabb5c5b82caad522868e18f..b9931ba3f860775caef8618f9e19496e48b25881 100644 (file)
@@ -109,9 +109,9 @@ fn to_str(j: json) -> str {
 
 type parser = {
     rdr: io::reader,
-    mutable ch: char,
-    mutable line: uint,
-    mutable col: uint,
+    mut ch: char,
+    mut line: uint,
+    mut col: uint,
 };
 
 impl parser for parser {
@@ -458,9 +458,9 @@ fn parse_object() -> result<json, error> {
 fn from_reader(rdr: io::reader) -> result<json, error> {
     let parser = {
         rdr: rdr,
-        mutable ch: rdr.read_char(),
-        mutable line: 1u,
-        mutable col: 1u,
+        mut ch: rdr.read_char(),
+        mut line: 1u,
+        mut col: 1u,
     };
 
     parser.parse()
index ca3905dd246abb303f00a81811cf4fcd287ee4da..bf2f51cf82d95b8bb6307970cdc16c688b2c556b 100644 (file)
@@ -164,7 +164,7 @@ fn test_from_vec_empty() {
 
     #[test]
     fn test_from_vec_mut() {
-        let l = from_vec([mutable 0, 1, 2]);
+        let l = from_vec([mut 0, 1, 2]);
 
         assert (head(l) == 0);
 
index 5722789e64ad8d464a5ca8f8bc975ec2293f7cc4..a35b51be900cf4ace603e78f138c08b4e222a7d2 100644 (file)
@@ -71,8 +71,8 @@ mod chained {
     type entry<K, V> = {
         hash: uint,
         key: K,
-        mutable value: V,
-        mutable next: chain<K, V>
+        mut value: V,
+        mut next: chain<K, V>
     };
 
     enum chain<K, V> {
@@ -81,8 +81,8 @@ enum chain<K, V> {
     }
 
     type t<K, V> = @{
-        mutable count: uint,
-        mutable chains: [mutable chain<K,V>],
+        mut count: uint,
+        mut chains: [mut chain<K,V>],
         hasher: hashfn<K>,
         eqer: eqfn<K>
     };
@@ -152,8 +152,8 @@ fn insert<K: copy, V: copy>(tbl: t<K,V>, k: K, v: V) -> bool {
             tbl.chains[idx] = present(@{
                 hash: hash,
                 key: k,
-                mutable value: v,
-                mutable next: old_chain});
+                mut value: v,
+                mut next: old_chain});
             ret true;
           }
           found_first(_, entry) {
@@ -203,7 +203,7 @@ fn remove<K: copy, V: copy>(tbl: t<K,V>, k: K) -> core::option<V> {
         }
     }
 
-    fn chains<K: copy, V: copy>(nchains: uint) -> [mutable chain<K,V>] {
+    fn chains<K: copy, V: copy>(nchains: uint) -> [mut chain<K,V>] {
         ret vec::to_mut(vec::from_elem(nchains, absent));
     }
 
@@ -286,8 +286,8 @@ fn values(blk: fn(V)) { items(self) { |_k, v| blk(v) } }
 
     fn mk<K: copy, V: copy>(hasher: hashfn<K>, eqer: eqfn<K>) -> t<K,V> {
         let initial_capacity: uint = 32u; // 2^5
-        let slf: t<K, V> = @{mutable count: 0u,
-                             mutable chains: chains(initial_capacity),
+        let slf: t<K, V> = @{mut count: 0u,
+                             mut chains: chains(initial_capacity),
                              hasher: hasher,
                              eqer: eqer};
         slf
index 2452188db246b8188373ce5db9a6c63d5b03fc14..735d273faa302d2b669bf6376a5e35d26d6a4a9d 100644 (file)
@@ -154,7 +154,7 @@ fn append_rope(left: rope, right: rope) -> rope {
 measure to ensure that the result is balanced.
 "]
 fn concat(v: [rope]) -> rope {
-    //Copy `v` into a mutable vector
+    //Copy `v` into a mut vector
     let mut len = vec::len(v);
     if len == 0u { ret node::empty; }
     let ropes = vec::to_mut(vec::from_elem(len, v[0]));
@@ -752,7 +752,7 @@ fn of_substr_unsafer(str: @str, byte_start: uint, byte_len: uint,
     * forest - The forest. This vector is progressively rewritten during
                execution and should be discarded as meaningless afterwards.
     "]
-    fn tree_from_forest_destructive(forest: [mutable @node]) -> @node {
+    fn tree_from_forest_destructive(forest: [mut @node]) -> @node {
         let mut i = 0u;
         let mut len = vec::len(forest);
         while len > 1u {
@@ -861,12 +861,12 @@ fn flatten(node: @node) -> @node unsafe {
     fn bal(node: @node) -> option<@node> {
         if height(node) < hint_max_node_height { ret option::none; }
         //1. Gather all leaves as a forest
-        let mut forest = [mutable];
+        let mut forest = [mut];
         let it = leaf_iterator::start(node);
         loop {
             alt (leaf_iterator::next(it)) {
               option::none   { break; }
-              option::some(x) { forest += [mutable @leaf(x)]; }
+              option::some(x) { forest += [mut @leaf(x)]; }
             }
         }
         //2. Rebuild tree from forest
@@ -1117,20 +1117,20 @@ fn char_at(node: @node, pos: uint) -> char {
 
     mod leaf_iterator {
         type t = {
-            stack:            [mutable @node],
-            mutable stackpos: int
+            stack:            [mut @node],
+            mut stackpos: int
         };
 
         fn empty() -> t {
-            let stack : [mutable @node] = [mutable];
-            ret {stack: stack, mutable stackpos: -1}
+            let stack : [mut @node] = [mut];
+            ret {stack: stack, mut stackpos: -1}
         }
 
         fn start(node: @node) -> t {
             let stack = vec::to_mut(vec::from_elem(height(node)+1u, node));
             ret {
                 stack:             stack,
-                mutable stackpos:  0
+                mut stackpos:  0
             }
         }
 
@@ -1157,23 +1157,23 @@ fn next(it: t) -> option<leaf> {
     mod char_iterator {
         type t = {
             leaf_iterator: leaf_iterator::t,
-            mutable leaf:  option<leaf>,
-            mutable leaf_byte_pos: uint
+            mut leaf:  option<leaf>,
+            mut leaf_byte_pos: uint
         };
 
         fn start(node: @node) -> t {
             ret {
                 leaf_iterator: leaf_iterator::start(node),
-                mutable leaf:          option::none,
-                mutable leaf_byte_pos: 0u
+                mut leaf:          option::none,
+                mut leaf_byte_pos: 0u
             }
         }
 
         fn empty() -> t {
             ret {
                 leaf_iterator: leaf_iterator::empty(),
-                mutable leaf:  option::none,
-                mutable leaf_byte_pos: 0u
+                mut leaf:  option::none,
+                mut leaf_byte_pos: 0u
             }
         }
 
@@ -1242,8 +1242,8 @@ fn rope_to_string(r: rope) -> str {
         alt(r) {
           node::empty { ret "" }
           node::content(x) {
-            let str = @mutable "";
-            fn aux(str: @mutable str, node: @node::node) unsafe {
+            let str = @mut "";
+            fn aux(str: @mut str, node: @node::node) unsafe {
                 alt(*node) {
                   node::leaf(x) {
                     *str += str::slice(
@@ -1280,7 +1280,7 @@ fn of_string1() {
 
     #[test]
     fn of_string2() {
-        let buf = @ mutable "1234567890";
+        let buf = @ mut "1234567890";
         let mut i = 0;
         while i < 10 { *buf = *buf + *buf; i+=1;}
         let sample = @*buf;
@@ -1313,7 +1313,7 @@ fn of_string2() {
 
     #[test]
     fn iter1() {
-        let buf = @ mutable "1234567890";
+        let buf = @ mut "1234567890";
         let mut i = 0;
         while i < 10 { *buf = *buf + *buf; i+=1;}
         let sample = @*buf;
@@ -1334,7 +1334,7 @@ fn iter1() {
     #[test]
     fn bal1() {
         let init = @ "1234567890";
-        let buf  = @ mutable * init;
+        let buf  = @ mut * init;
         let mut i = 0;
         while i < 8 { *buf = *buf + *buf; i+=1;}
         let sample = @*buf;
index 4d5aabf705db6c62184e3248994c763966f0e7d0..8e5f0cb122ae451655140bf3a706849ac9f0e9b7 100644 (file)
 #[doc = "Construct a `sha` object"]
 fn sha1() -> sha1 {
     type sha1state =
-        {h: [mutable u32],
-         mutable len_low: u32,
-         mutable len_high: u32,
-         msg_block: [mutable u8],
-         mutable msg_block_idx: uint,
-         mutable computed: bool,
-         work_buf: [mutable u32]};
+        {h: [mut u32],
+         mut len_low: u32,
+         mut len_high: u32,
+         msg_block: [mut u8],
+         mut msg_block_idx: uint,
+         mut computed: bool,
+         work_buf: [mut u32]};
 
     fn add_input(st: sha1state, msg: [u8]) {
         // FIXME: Should be typestate precondition
@@ -244,11 +244,11 @@ fn result_str() -> str {
     }
     let st = {
         h: vec::to_mut(vec::from_elem(digest_buf_len, 0u32)),
-        mutable len_low: 0u32,
-        mutable len_high: 0u32,
+        mut len_low: 0u32,
+        mut len_high: 0u32,
         msg_block: vec::to_mut(vec::from_elem(msg_block_len, 0u8)),
-        mutable msg_block_idx: 0u,
-        mutable computed: false,
+        mut msg_block_idx: 0u,
+        mut computed: false,
         work_buf: vec::to_mut(vec::from_elem(work_buf_len, 0u32))
     };
     let sh = st as sha1;
index d58e0519387e44555c44a1f359e4adf60324ca6c..a088cd52f68a0a696d0305a71a9f7e6478e80e7e 100644 (file)
@@ -7,12 +7,12 @@
 
 // FIXME: Should not be @; there's a bug somewhere in rustc that requires this
 // to be.
-type smallintmap<T: copy> = @{mutable v: [mutable option<T>]};
+type smallintmap<T: copy> = @{mut v: [mut option<T>]};
 
 #[doc = "Create a smallintmap"]
 fn mk<T: copy>() -> smallintmap<T> {
-    let v: [mutable option<T>] = [mutable];
-    ret @{mutable v: v};
+    let v: [mut option<T>] = [mut];
+    ret @{mut v: v};
 }
 
 #[doc = "
index 461dd1bab3aa41fc25e253906a9cef4b94aff75f..8385158e93a706b21216ce8b931b0f4038fcb7e5 100644 (file)
@@ -51,7 +51,7 @@ fn merge<T: copy>(le: le<T>, a: [T], b: [T]) -> [T] {
     }
 }
 
-fn part<T: copy>(compare_func: le<T>, arr: [mutable T], left: uint,
+fn part<T: copy>(compare_func: le<T>, arr: [mut T], left: uint,
                 right: uint, pivot: uint) -> uint {
     let pivot_value = arr[pivot];
     arr[pivot] <-> arr[right];
@@ -68,7 +68,7 @@ fn part<T: copy>(compare_func: le<T>, arr: [mutable T], left: uint,
     ret storage_index;
 }
 
-fn qsort<T: copy>(compare_func: le<T>, arr: [mutable T], left: uint,
+fn qsort<T: copy>(compare_func: le<T>, arr: [mut T], left: uint,
              right: uint) {
     if right > left {
         let pivot = (left + right) / 2u;
@@ -82,18 +82,18 @@ fn qsort<T: copy>(compare_func: le<T>, arr: [mutable T], left: uint,
 }
 
 #[doc = "
-Quicksort. Sorts a mutable vector in place.
+Quicksort. Sorts a mut vector in place.
 
 Has worst case O(n^2) performance, average case O(n log n).
 This is an unstable sort.
 "]
-fn quick_sort<T: copy>(compare_func: le<T>, arr: [mutable T]) {
+fn quick_sort<T: copy>(compare_func: le<T>, arr: [mut T]) {
     if len::<T>(arr) == 0u { ret; }
     qsort::<T>(compare_func, arr, 0u, len::<T>(arr) - 1u);
 }
 
 fn qsort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
-                  arr: [mutable T], left: int, right: int) {
+                  arr: [mut T], left: int, right: int) {
     if right <= left { ret; }
     let v: T = arr[right];
     let mut i: int = left - 1;
@@ -142,7 +142,7 @@ fn qsort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
 
 // FIXME: This should take lt and eq types
 #[doc = "
-Fancy quicksort. Sorts a mutable vector in place.
+Fancy quicksort. Sorts a mut vector in place.
 
 Based on algorithm presented by [Sedgewick and Bentley]
 (http://www.cs.princeton.edu/~rs/talks/QuicksortIsOptimal.pdf).
@@ -152,7 +152,7 @@ fn qsort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
 This is an unstable sort.
 "]
 fn quick_sort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
-                       arr: [mutable T]) {
+                       arr: [mut T]) {
     if len::<T>(arr) == 0u { ret; }
     qsort3::<T>(compare_func_lt, compare_func_eq, arr, 0,
                 (len::<T>(arr) as int) - 1);
@@ -160,7 +160,7 @@ fn quick_sort3<T: copy>(compare_func_lt: le<T>, compare_func_eq: le<T>,
 
 #[cfg(test)]
 mod test_qsort3 {
-    fn check_sort(v1: [mutable int], v2: [mutable int]) {
+    fn check_sort(v1: [mut int], v2: [mut int]) {
         let len = vec::len::<int>(v1);
         fn lt(&&a: int, &&b: int) -> bool { ret a < b; }
         fn equal(&&a: int, &&b: int) -> bool { ret a == b; }
@@ -178,24 +178,24 @@ fn check_sort(v1: [mutable int], v2: [mutable int]) {
     #[test]
     fn test() {
         {
-            let v1 = [mutable 3, 7, 4, 5, 2, 9, 5, 8];
-            let v2 = [mutable 2, 3, 4, 5, 5, 7, 8, 9];
+            let v1 = [mut 3, 7, 4, 5, 2, 9, 5, 8];
+            let v2 = [mut 2, 3, 4, 5, 5, 7, 8, 9];
             check_sort(v1, v2);
         }
         {
-            let v1 = [mutable 1, 1, 1];
-            let v2 = [mutable 1, 1, 1];
+            let v1 = [mut 1, 1, 1];
+            let v2 = [mut 1, 1, 1];
             check_sort(v1, v2);
         }
         {
-            let v1: [mutable int] = [mutable];
-            let v2: [mutable int] = [mutable];
+            let v1: [mut int] = [mut];
+            let v2: [mut int] = [mut];
             check_sort(v1, v2);
         }
-        { let v1 = [mutable 9]; let v2 = [mutable 9]; check_sort(v1, v2); }
+        { let v1 = [mut 9]; let v2 = [mut 9]; check_sort(v1, v2); }
         {
-            let v1 = [mutable 9, 3, 3, 3, 9];
-            let v2 = [mutable 3, 3, 3, 9, 9];
+            let v1 = [mut 9, 3, 3, 3, 9];
+            let v2 = [mut 3, 3, 3, 9, 9];
             check_sort(v1, v2);
         }
     }
@@ -203,7 +203,7 @@ fn test() {
 
 #[cfg(test)]
 mod test_qsort {
-    fn check_sort(v1: [mutable int], v2: [mutable int]) {
+    fn check_sort(v1: [mut int], v2: [mut int]) {
         let len = vec::len::<int>(v1);
         fn leual(&&a: int, &&b: int) -> bool { ret a <= b; }
         let f = leual;
@@ -219,24 +219,24 @@ fn check_sort(v1: [mutable int], v2: [mutable int]) {
     #[test]
     fn test() {
         {
-            let v1 = [mutable 3, 7, 4, 5, 2, 9, 5, 8];
-            let v2 = [mutable 2, 3, 4, 5, 5, 7, 8, 9];
+            let v1 = [mut 3, 7, 4, 5, 2, 9, 5, 8];
+            let v2 = [mut 2, 3, 4, 5, 5, 7, 8, 9];
             check_sort(v1, v2);
         }
         {
-            let v1 = [mutable 1, 1, 1];
-            let v2 = [mutable 1, 1, 1];
+            let v1 = [mut 1, 1, 1];
+            let v2 = [mut 1, 1, 1];
             check_sort(v1, v2);
         }
         {
-            let v1: [mutable int] = [mutable];
-            let v2: [mutable int] = [mutable];
+            let v1: [mut int] = [mut];
+            let v2: [mut int] = [mut];
             check_sort(v1, v2);
         }
-        { let v1 = [mutable 9]; let v2 = [mutable 9]; check_sort(v1, v2); }
+        { let v1 = [mut 9]; let v2 = [mut 9]; check_sort(v1, v2); }
         {
-            let v1 = [mutable 9, 3, 3, 3, 9];
-            let v2 = [mutable 3, 3, 3, 9, 9];
+            let v1 = [mut 9, 3, 3, 3, 9];
+            let v2 = [mut 3, 3, 3, 9, 9];
             check_sort(v1, v2);
         }
     }
@@ -244,7 +244,7 @@ fn test() {
     // Regression test for #750
     #[test]
     fn test_simple() {
-        let names = [mutable 2, 1, 3];
+        let names = [mut 2, 1, 3];
 
         let expected = [1, 2, 3];
 
@@ -294,7 +294,7 @@ fn test() {
     #[test]
     fn test_merge_sort_mutable() {
         fn le(&&a: int, &&b: int) -> bool { ret a <= b; }
-        let v1 = [mutable 3, 2, 1];
+        let v1 = [mut 3, 2, 1];
         let v2 = merge_sort(le, v1);
         assert v2 == [1, 2, 3];
     }
index 271fac730ab9e4838e718dabfc53ad450aaf926c..5847dea1e4ed5a975e41200cf024527ff7097964 100644 (file)
@@ -88,11 +88,11 @@ enum test_result { tr_ok, tr_failed, tr_ignored, }
 type console_test_state =
     @{out: io::writer,
       use_color: bool,
-      mutable total: uint,
-      mutable passed: uint,
-      mutable failed: uint,
-      mutable ignored: uint,
-      mutable failures: [test_desc]};
+      mut total: uint,
+      mut passed: uint,
+      mut failed: uint,
+      mut ignored: uint,
+      mut failures: [test_desc]};
 
 // A simple console test runner
 fn run_tests_console(opts: test_opts,
@@ -131,11 +131,11 @@ fn callback(event: testevent, st: console_test_state) {
     let st =
         @{out: io::stdout(),
           use_color: use_color(),
-          mutable total: 0u,
-          mutable passed: 0u,
-          mutable failed: 0u,
-          mutable ignored: 0u,
-          mutable failures: []};
+          mut total: 0u,
+          mut passed: 0u,
+          mut failed: 0u,
+          mut ignored: 0u,
+          mut failures: []};
 
     run_tests(opts, tests, bind callback(_, st));
 
@@ -210,11 +210,11 @@ fn should_sort_failures_before_printing_them() {
     let st =
         @{out: writer,
           use_color: false,
-          mutable total: 0u,
-          mutable passed: 0u,
-          mutable failed: 0u,
-          mutable ignored: 0u,
-          mutable failures: [test_b, test_a]};
+          mut total: 0u,
+          mut passed: 0u,
+          mut failed: 0u,
+          mut ignored: 0u,
+          mut failures: [test_b, test_a]};
 
     print_failures(st);
 
index 54e38483a97fac98b2493b9af9ec48086947f7b7..ebf532ab19d502f037869e9aa77049adb7f70d56 100644 (file)
 export find;
 export traverse;
 
-type treemap<K, V> = @mutable tree_node<K, V>;
+type treemap<K, V> = @mut tree_node<K, V>;
 
 enum tree_node<K, V> { empty, node(@K, @V, treemap<K, V>, treemap<K, V>) }
 
 #[doc = "Create a treemap"]
-fn treemap<K, V>() -> treemap<K, V> { @mutable empty }
+fn treemap<K, V>() -> treemap<K, V> { @mut empty }
 
 #[doc = "Insert a value into the map"]
 fn insert<K: copy, V: copy>(m: treemap<K, V>, k: K, v: V) {
     alt m {
-      @empty { *m = node(@k, @v, @mutable empty, @mutable empty); }
+      @empty { *m = node(@k, @v, @mut empty, @mut empty); }
       @node(@kk, _, _, _) {
 
         // We have to name left and right individually, because
@@ -114,8 +114,8 @@ fn traverse_in_order() {
         insert(m, 2, ());
         insert(m, 1, ());
 
-        let n = @mutable 0;
-        fn t(n: @mutable int, &&k: int, &&_v: ()) {
+        let n = @mut 0;
+        fn t(n: @mut int, &&k: int, &&_v: ()) {
             assert (*n == k); *n += 1;
         }
         traverse(m, bind t(n, _, _));
index 53bdabfc203feae7f64796237cd9694b46031445..555c0a0f2127e6d18abf612eb7562e08752d5e5c 100644 (file)
@@ -8,13 +8,13 @@
 // than the node itself.
 type node = option<uint>;
 
-type ufind = {mutable nodes: [mutable node]};
+type ufind = {mut nodes: [mut node]};
 
-fn make() -> ufind { ret {mutable nodes: [mutable]}; }
+fn make() -> ufind { ret {mut nodes: [mut]}; }
 
 fn make_set(ufnd: ufind) -> uint {
     let idx = vec::len(ufnd.nodes);
-    ufnd.nodes += [mutable none::<uint>];
+    ufnd.nodes += [mut none::<uint>];
     ret idx;
 }
 
index cb4d59e70a1fcec4513d253423c5ed2e8fc8dbfb..d76d0447b111f7896c9569740a9ddd1dbc1c4cae 100644 (file)
@@ -37,7 +37,7 @@
 }
 
 type handler_t = @{
-    mutable err_count: uint,
+    mut err_count: uint,
     _emit: emitter
 };
 
@@ -127,7 +127,7 @@ fn mk_handler(emitter: option<emitter>) -> handler {
     };
 
     @{
-        mutable err_count: 0u,
+        mut err_count: 0u,
         _emit: emit
     } as handler
 }
index a71c5dcb0ca96f5f71f17b2ee7e9ea72b55f2d18..349c29a6f85f15dd55b4e7b6a0f78908a461e58f 100644 (file)
@@ -479,17 +479,17 @@ fn build_session_(
       cstore: cstore,
       parse_sess: @{
           cm: codemap,
-          mutable next_id: 1,
+          mut next_id: 1,
           span_diagnostic: span_diagnostic_handler,
-          mutable chpos: 0u,
-          mutable byte_pos: 0u
+          mut chpos: 0u,
+          mut byte_pos: 0u
       },
       codemap: codemap,
       // For a library crate, this is always none
-      mutable main_fn: none,
+      mut main_fn: none,
       span_diagnostic: span_diagnostic_handler,
       filesearch: filesearch,
-      mutable building_library: false,
+      mut building_library: false,
       working_dir: os::getcwd()}
 }
 
index 79f9a44aaa0f2d22631d9b16c2ccbfdda67e38a7..d604db38e15b37770e1e91723613fbed44111290 100644 (file)
@@ -56,10 +56,10 @@ enum crate_type { bin_crate, lib_crate, unknown_crate, }
                  parse_sess: parse_sess,
                  codemap: codemap::codemap,
                  // For a library crate, this is always none
-                 mutable main_fn: option<(node_id, codemap::span)>,
+                 mut main_fn: option<(node_id, codemap::span)>,
                  span_diagnostic: diagnostic::span_handler,
                  filesearch: filesearch::filesearch,
-                 mutable building_library: bool,
+                 mut building_library: bool,
                  working_dir: str};
 
 impl session for session {
index 599da3811d17fec42cfdac8cfe2914d51c582b21..0230baefdc13eaf2a8d45144a2e65486b2a858c0 100644 (file)
@@ -198,8 +198,8 @@ fn key(m: @ast::meta_item) -> ast::ident {
     }
 
     // This is sort of stupid here, converting to a vec of mutables and back
-    let mut v: [mutable @ast::meta_item] = [mutable];
-    for mi: @ast::meta_item in items { v += [mutable mi]; }
+    let mut v: [mut @ast::meta_item] = [mut];
+    for mi: @ast::meta_item in items { v += [mut mi]; }
 
     std::sort::quick_sort(lteq, v);
 
index 4af7e77bd8723bbe43caa6824b0cc0a8bb032769..d39936c10ccc5da2d8df72c3122762fc4a2106c5 100644 (file)
@@ -19,8 +19,8 @@
 type test_ctxt =
     @{sess: session::session,
       crate: @ast::crate,
-      mutable path: [ast::ident],
-      mutable testfns: [test]};
+      mut path: [ast::ident],
+      mut testfns: [test]};
 
 // Traverse the crate, collecting all the test functions, eliding any
 // existing main functions, and synthesizing a main test harness
@@ -39,8 +39,8 @@ fn generate_test_harness(sess: session::session,
     let cx: test_ctxt =
         @{sess: sess,
           crate: crate,
-          mutable path: [],
-          mutable testfns: []};
+          mut path: [],
+          mut testfns: []};
 
     let precursor =
         {fold_crate: fold::wrap(bind fold_crate(cx, _, _)),
index 42f24b79851382b9e0d1aa0edbf8634e01483338..51c97ef261e5e1166294d9f16a43d65b04e51262 100644 (file)
@@ -234,8 +234,8 @@ fn visit_ids(item: ast::inlined_item, vfn: fn@(ast::node_id)) {
 }
 
 fn compute_id_range(item: ast::inlined_item) -> id_range {
-    let min = @mutable int::max_value;
-    let max = @mutable int::min_value;
+    let min = @mut int::max_value;
+    let max = @mut int::min_value;
     visit_ids(item) {|id|
         *min = int::min(*min, id);
         *max = int::max(*max, id + 1);
@@ -684,7 +684,7 @@ fn encode_side_tables_for_ii(ecx: @e::encode_ctxt,
     ebml_w.wr_tag(c::tag_table as uint) {||
         visit_ids(ii, fn@(id: ast::node_id) {
             // Note: this will cause a copy of ebml_w, which is bad as
-            // it has mutable fields.  But I believe it's harmless since
+            // it has mut fields.  But I believe it's harmless since
             // we generate balanced EBML.
             encode_side_tables_for_id(ecx, ebml_w, id)
         });
@@ -943,10 +943,10 @@ fn new_parse_sess() -> parser::parse_sess {
     let handler = diagnostic::mk_handler(option::none);
     let sess = @{
         cm: cm,
-        mutable next_id: 1,
+        mut next_id: 1,
         span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-        mutable chpos: 0u,
-        mutable byte_pos: 0u
+        mut chpos: 0u,
+        mut byte_pos: 0u
     };
     ret sess;
 }
index 925995912405acdfd970b1af954273a213c7d3f5..fa74efbc19c349bf170cb31a86530a9737a9b0e4 100644 (file)
@@ -21,7 +21,7 @@
 fn read_crates(sess: session::session, crate: ast::crate) {
     let e = @{sess: sess,
               crate_cache: std::map::str_hash::<int>(),
-              mutable next_crate_num: 1};
+              mut next_crate_num: 1};
     let v =
         visit::mk_simple_visitor(@{visit_view_item:
                                        bind visit_view_item(e, _),
@@ -32,7 +32,7 @@ fn read_crates(sess: session::session, crate: ast::crate) {
 
 type env = @{sess: session::session,
              crate_cache: hashmap<str, int>,
-             mutable next_crate_num: ast::crate_num};
+             mut next_crate_num: ast::crate_num};
 
 fn visit_view_item(e: env, i: @ast::view_item) {
     alt i.node {
index 89e5343f6e4d81d595a7d056bf413f28f9d26049..36f2c28e74fb83ddf1b8fa60aafb85f43b8a6806 100644 (file)
@@ -53,9 +53,9 @@ enum cstore { private(cstore_private), }
     @{metas: map::hashmap<ast::crate_num, crate_metadata>,
       use_crate_map: use_crate_map,
       mod_path_map: mod_path_map,
-      mutable used_crate_files: [str],
-      mutable used_libraries: [str],
-      mutable used_link_args: [str]};
+      mut used_crate_files: [str],
+      mut used_libraries: [str],
+      mut used_link_args: [str]};
 
 // Map from node_id's of local use statements to crate numbers
 type use_crate_map = map::hashmap<ast::node_id, ast::crate_num>;
@@ -70,9 +70,9 @@ fn mk_cstore() -> cstore {
     ret private(@{metas: meta_cache,
                   use_crate_map: crate_map,
                   mod_path_map: mod_path_map,
-                  mutable used_crate_files: [],
-                  mutable used_libraries: [],
-                  mutable used_link_args: []});
+                  mut used_crate_files: [],
+                  mut used_libraries: [],
+                  mut used_link_args: []});
 }
 
 fn get_crate_data(cstore: cstore, cnum: ast::crate_num) -> crate_metadata {
index 37d7cb600782d95f1cf939c12f35461b02f73c56..a573d0214dc683eb337d40bfbdb9dda7c2305b7e 100644 (file)
@@ -283,7 +283,7 @@ fn encode_parent_item(ebml_w: ebml::writer, id: def_id) {
 
 fn encode_enum_variant_info(ecx: @encode_ctxt, ebml_w: ebml::writer,
                             id: node_id, variants: [variant],
-                            path: ast_map::path, index: @mutable [entry<int>],
+                            path: ast_map::path, index: @mut [entry<int>],
                             ty_params: [ty_param]) {
     let mut disr_val = 0;
     let mut i = 0;
@@ -362,9 +362,9 @@ fn encode_privacy(ebml_w: ebml::writer, privacy: privacy) {
 fn encode_info_for_class(ecx: @encode_ctxt, ebml_w: ebml::writer,
                          id: node_id, path: ast_map::path,
                          items: [@class_item],
-                         global_index: @mutable[entry<int>])
+                         global_index: @mut[entry<int>])
  -> [entry<int>] {
-    let index = @mutable [];
+    let index = @mut [];
     let tcx = ecx.ccx.tcx;
     for ci in items {
      /* We encode both private and public fields -- need to include
@@ -466,14 +466,14 @@ fn should_inline(attrs: [attribute]) -> bool {
 
 
 fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
-                        index: @mutable [entry<int>], path: ast_map::path) {
+                        index: @mut [entry<int>], path: ast_map::path) {
 
     let tcx = ecx.ccx.tcx;
     let must_write = alt item.node { item_enum(_, _) { true } _ { false } };
     if !must_write && !ecx.ccx.reachable.contains_key(item.id) { ret; }
 
     fn add_to_index_(item: @item, ebml_w: ebml::writer,
-                     index: @mutable [entry<int>]) {
+                     index: @mut [entry<int>]) {
         *index += [{val: item.id, pos: ebml_w.writer.tell()}];
     }
     let add_to_index = bind add_to_index_(item, ebml_w, index);
@@ -678,7 +678,7 @@ fn add_to_index_(item: @item, ebml_w: ebml::writer,
 
 fn encode_info_for_native_item(ecx: @encode_ctxt, ebml_w: ebml::writer,
                                nitem: @native_item,
-                               index: @mutable [entry<int>],
+                               index: @mut [entry<int>],
                                path: ast_map::path, abi: native_abi) {
     if !ecx.ccx.reachable.contains_key(nitem.id) { ret; }
     *index += [{val: nitem.id, pos: ebml_w.writer.tell()}];
@@ -704,7 +704,7 @@ fn encode_info_for_native_item(ecx: @encode_ctxt, ebml_w: ebml::writer,
 
 fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::writer,
                          crate: @crate) -> [entry<int>] {
-    let index = @mutable [];
+    let index = @mut [];
     ebml_w.start_tag(tag_items_data);
     *index += [{val: crate_node_id, pos: ebml_w.writer.tell()}];
     encode_info_for_mod(ecx, ebml_w, crate.node.module,
@@ -752,15 +752,15 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::writer,
 
 fn create_index<T: copy>(index: [entry<T>], hash_fn: fn@(T) -> uint) ->
    [@[entry<T>]] {
-    let mut buckets: [@mutable [entry<T>]] = [];
-    uint::range(0u, 256u) {|_i| buckets += [@mutable []]; };
+    let mut buckets: [@mut [entry<T>]] = [];
+    uint::range(0u, 256u) {|_i| buckets += [@mut []]; };
     for elt: entry<T> in index {
         let h = hash_fn(elt.val);
         *buckets[h % 256u] += [elt];
     }
 
     let mut buckets_frozen = [];
-    for bucket: @mutable [entry<T>] in buckets {
+    for bucket: @mut [entry<T>] in buckets {
         buckets_frozen += [@*bucket];
     }
     ret buckets_frozen;
@@ -901,9 +901,9 @@ fn get_ordered_names(cstore: cstore::cstore) -> [str] {
         type numname = {crate: crate_num, ident: str};
 
         // Pull the cnums and names out of cstore
-        let mut pairs: [mutable numname] = [mutable];
+        let mut pairs: [mut numname] = [mut];
         cstore::iter_crate_data(cstore) {|key, val|
-            pairs += [mutable {crate: key, ident: val.name}];
+            pairs += [mut {crate: key, ident: val.name}];
         };
 
         // Sort by cnum
@@ -919,7 +919,7 @@ fn lteq(kv1: numname, kv2: numname) -> bool { kv1.crate <= kv2.crate }
 
         // Return just the names
         fn name(kv: numname) -> str { kv.ident }
-        // mutable -> immutable hack for vec::map
+        // mut -> immutable hack for vec::map
         let immpairs = vec::slice(pairs, 0u, vec::len(pairs));
         ret vec::map(immpairs, name);
     }
index 3a925fdcb5ef8a0326157e3ebea8c94ab3c90f52..920a4d71a46681befcce353db8c72c4d01d25b4f 100644 (file)
@@ -17,7 +17,7 @@
 // Callback to translate defs to strs or back:
 type conv_did = fn(ast::def_id) -> ast::def_id;
 
-type pstate = {data: @[u8], crate: int, mutable pos: uint, tcx: ty::ctxt};
+type pstate = {data: @[u8], crate: int, mut pos: uint, tcx: ty::ctxt};
 
 fn peek(st: @pstate) -> char {
     st.data[st.pos] as char
@@ -52,7 +52,7 @@ fn parse_ident_(st: @pstate, is_last: fn@(char) -> bool) ->
 
 fn parse_ty_data(data: @[u8], crate_num: int, pos: uint, tcx: ty::ctxt,
                  conv: conv_did) -> ty::t {
-    let st = @{data: data, crate: crate_num, mutable pos: pos, tcx: tcx};
+    let st = @{data: data, crate: crate_num, mut pos: pos, tcx: tcx};
     parse_ty(st, conv)
 }
 
@@ -416,7 +416,7 @@ fn parse_def_id(buf: [u8]) -> ast::def_id {
 fn parse_bounds_data(data: @[u8], start: uint,
                      crate_num: int, tcx: ty::ctxt, conv: conv_did)
     -> @[ty::param_bound] {
-    let st = @{data: data, crate: crate_num, mutable pos: start, tcx: tcx};
+    let st = @{data: data, crate: crate_num, mut pos: start, tcx: tcx};
     parse_bounds(st, conv)
 }
 
index fd6e7eb3ff27d69db923fc4af4547079e7a00668..32e5ef9152468b4de701012e21b4a7afd32447c4 100644 (file)
@@ -30,11 +30,11 @@ enum unsafe_ty { contains(ty::t), mutbl_contains(ty::t), }
                  root_var: option<node_id>,
                  local_id: uint,
                  unsafe_tys: [unsafe_ty],
-                 mutable copied: copied};
+                 mut copied: copied};
 
 // FIXME it may be worthwhile to use a linked list of bindings instead
 type scope = {bs: [binding],
-              invalid: @mutable list<@invalid>};
+              invalid: @mut list<@invalid>};
 
 fn mk_binding(cx: ctx, id: node_id, span: span, root_var: option<node_id>,
               unsafe_tys: [unsafe_ty]) -> binding {
@@ -45,7 +45,7 @@ fn mk_binding(cx: ctx, id: node_id, span: span, root_var: option<node_id>,
     ret @{node_id: id, span: span, root_var: root_var,
           local_id: local_id_of_node(cx, id),
           unsafe_tys: unsafe_tys,
-          mutable copied: not_copied};
+          mut copied: not_copied};
 }
 
 enum local_info { local(uint), }
@@ -56,7 +56,7 @@ enum local_info { local(uint), }
 type ctx = {tcx: ty::ctxt,
             copy_map: copy_map,
             ref_map: ref_map,
-            mutable silent: bool};
+            mut silent: bool};
 
 fn check_crate(tcx: ty::ctxt, crate: @ast::crate) -> (copy_map, ref_map) {
     // Stores information about function arguments that's otherwise not easily
@@ -64,12 +64,12 @@ fn check_crate(tcx: ty::ctxt, crate: @ast::crate) -> (copy_map, ref_map) {
     let cx = @{tcx: tcx,
                copy_map: std::map::int_hash(),
                ref_map: std::map::int_hash(),
-               mutable silent: false};
+               mut silent: false};
     let v = @{visit_fn: bind visit_fn(cx, _, _, _, _, _, _, _),
               visit_expr: bind visit_expr(cx, _, _, _),
               visit_block: bind visit_block(cx, _, _, _)
               with *visit::default_visitor::<scope>()};
-    let sc = {bs: [], invalid: @mutable list::nil};
+    let sc = {bs: [], invalid: @mut list::nil};
     visit::visit_crate(*crate, sc, visit::mk_vt(v));
     tcx.sess.abort_if_errors();
     ret (cx.copy_map, cx.ref_map);
@@ -89,7 +89,7 @@ fn visit_fn(cx: @ctx, _fk: visit::fn_kind, decl: ast::fn_decl,
         check_loop(*cx, sc) {|| v.visit_block(body, sc, v);}
       }
       ast::proto_box | ast::proto_uniq | ast::proto_bare {
-        let sc = {bs: [], invalid: @mutable list::nil};
+        let sc = {bs: [], invalid: @mut list::nil};
         v.visit_block(body, sc, v);
       }
     }
@@ -242,7 +242,7 @@ fn check_call(cx: ctx, sc: scope, f: @ast::expr, args: [@ast::expr])
                        root_var: root_var,
                        local_id: 0u,
                        unsafe_tys: unsafe_set(root.mutbl),
-                       mutable copied: arg_copied}];
+                       mut copied: arg_copied}];
         i += 1u;
     }
     let f_may_close =
@@ -291,7 +291,7 @@ fn check_call(cx: ctx, sc: scope, f: @ast::expr, args: [@ast::expr])
         }
         j += 1u;
     }
-    // Ensure we're not passing a root by mutable alias.
+    // Ensure we're not passing a root by mut alias.
 
     for {node: node, arg: arg} in mut_roots {
         let mut i = 0u;
@@ -301,7 +301,7 @@ fn check_call(cx: ctx, sc: scope, f: @ast::expr, args: [@ast::expr])
                   some(root) {
                     if node == root && cant_copy(cx, b) {
                         err(cx, args[arg].span,
-                            "passing a mutable reference to a \
+                            "passing a mut reference to a \
                              variable that roots another reference");
                         break;
                     }
@@ -327,7 +327,7 @@ fn check_alt(cx: ctx, input: @ast::expr, arms: [ast::arm], sc: scope,
         let pat_id_map = pat_util::pat_id_map(cx.tcx.def_map, a.pats[0]);
         type info = {
             id: node_id,
-            mutable unsafe_tys: [unsafe_ty],
+            mut unsafe_tys: [unsafe_ty],
             span: span};
         let mut binding_info: [info] = [];
         for pat in a.pats {
@@ -338,7 +338,7 @@ fn check_alt(cx: ctx, input: @ast::expr, arms: [ast::arm], sc: scope,
                   none {
                       binding_info += [
                           {id: canon_id,
-                           mutable unsafe_tys: unsafe_set(proot.mutbl),
+                           mut unsafe_tys: unsafe_set(proot.mutbl),
                            span: proot.span}];
                   }
                 }
@@ -359,7 +359,7 @@ fn check_for(cx: ctx, local: @ast::local, seq: @ast::expr, blk: ast::blk,
              sc: scope, v: vt<scope>) {
     let root = expr_root(cx, seq, false);
 
-    // If this is a mutable vector, don't allow it to be touched.
+    // If this is a mut vector, don't allow it to be touched.
     let seq_t = ty::expr_ty(cx.tcx, seq);
     let mut cur_mutbl = root.mutbl;
     alt ty::get(seq_t).struct {
@@ -522,7 +522,7 @@ fn helper(tcx: ty::ctxt, needle: unsafe_ty, haystack: ty::t, mutbl: bool)
           ty::ty_fn(_) | ty::ty_iface(_, _) { ret true; }
           // A type param may include everything, but can only be
           // treated as opaque downstream, and is thus safe unless we
-          // saw mutable fields, in which case the whole thing can be
+          // saw mut fields, in which case the whole thing can be
           // overwritten.
           ty::ty_param(_, _) { ret mutbl; }
           _ { ret false; }
index d2186a27ee837b51c27f6bfd3eee3c1f65f09624..3b9a868776b73c2665050aaf9d99fe6a73d8c2ab 100644 (file)
@@ -40,8 +40,8 @@ enum ast_node {
 }
 
 type map = std::map::hashmap<node_id, ast_node>;
-type ctx = {map: map, mutable path: path,
-            mutable local_id: uint, sess: session};
+type ctx = {map: map, mut path: path,
+            mut local_id: uint, sess: session};
 type vt = visit::vt<ctx>;
 
 fn extend(cx: ctx, elt: str) -> @path {
@@ -63,8 +63,8 @@ fn mk_ast_map_visitor() -> vt {
 
 fn map_crate(sess: session, c: crate) -> map {
     let cx = {map: std::map::int_hash(),
-              mutable path: [],
-              mutable local_id: 0u,
+              mut path: [],
+              mut local_id: 0u,
               sess: sess};
     visit::visit_crate(c, cx, mk_ast_map_visitor());
     ret cx.map;
@@ -81,8 +81,8 @@ fn map_decoded_item(sess: session, map: map, path: path, ii: inlined_item) {
     // even if we did I think it only needs an ordering between local
     // variables that are simultaneously in scope).
     let cx = {map: map,
-              mutable path: path,
-              mutable local_id: 0u,
+              mut path: path,
+              mut local_id: 0u,
               sess: sess};
     let v = mk_ast_map_visitor();
 
index 6646e1612c86a84f49e7358767626419fc847a77..c0719e47ad32022d4f3885afea4b91d60d050d30 100644 (file)
@@ -2,10 +2,10 @@
 import syntax::ast::*;
 import driver::session::session;
 
-type ctx = {tcx: ty::ctxt, mutable allow_block: bool};
+type ctx = {tcx: ty::ctxt, mut allow_block: bool};
 
 fn check_crate(tcx: ty::ctxt, crate: @crate) {
-    let cx = {tcx: tcx, mutable allow_block: false};
+    let cx = {tcx: tcx, mut allow_block: false};
     let v = visit::mk_vt(@{visit_expr: visit_expr
                            with *visit::default_visitor()});
     visit::visit_crate(*crate, cx, v);
index 1a97b276afe1d17cfe75a8cac68687e7bbf8dfd6..eacb5fef32ca28a859cd9641f41373ad83f4d018 100644 (file)
@@ -101,8 +101,8 @@ fn check_exhaustive(tcx: ty::ctxt, sp: span, pats: [@pat]) {
         vec::iter(cols) {|col| check_exhaustive(tcx, sp, col); }
       }
       ty::ty_rec(fs) {
-        let cols = vec::from_elem(fs.len(), {mutable wild: false,
-                                            mutable pats: []});
+        let cols = vec::from_elem(fs.len(), {mut wild: false,
+                                            mut pats: []});
         for p in pats {
             alt raw_pat(p).node {
               pat_rec(sub, _) {
@@ -156,7 +156,7 @@ fn check_exhaustive_enum(tcx: ty::ctxt, enum_id: def_id, sp: span,
                          pats: [@pat]) {
     let variants = enum_variants(tcx, enum_id);
     let columns_by_variant = vec::map(*variants, {|v|
-        {mutable seen: false,
+        {mut seen: false,
          cols: vec::to_mut(vec::from_elem(v.args.len(), []))}
     });
 
index ad0f053884a6ee7b4cd528f52b1dfdb6b159663f..727cbac4f23409c46c612afaea390774b01af6af 100644 (file)
@@ -34,7 +34,7 @@
 fn collect_freevars(def_map: resolve::def_map, blk: ast::blk)
     -> freevar_info {
     let seen = int_hash();
-    let refs = @mutable [];
+    let refs = @mut [];
 
     fn ignore_item(_i: @ast::item, &&_depth: int, _v: visit::vt<int>) { }
 
index c0692e7c4a5aa21207028d8495f3403ec714f833..71419128eb1f9fd51ec0270f2106427ff586bb2b 100644 (file)
@@ -424,8 +424,8 @@ fn mts(a: ty::mt, b: ty::mt) -> ures {
 
         alt b.mutbl {
           ast::m_mutbl {
-            // If supertype is mutable, subtype must match exactly
-            // (i.e., invariant if mutable):
+            // If supertype is mut, subtype must match exactly
+            // (i.e., invariant if mut):
             self.eq_tys(a.ty, b.ty)
           }
           ast::m_imm | ast::m_const {
@@ -751,7 +751,7 @@ fn resolve_ty(typ: ty::t) -> fres<ty::t> {
         }
     }
 
-    fn subst_vars(unresolved: @mutable option<int>,
+    fn subst_vars(unresolved: @mut option<int>,
                   vars_seen: std::list::list<int>,
                   vid: int) -> ty::t {
         // Should really return a fixup_result instead of a t, but fold_ty
@@ -785,7 +785,7 @@ fn subst_vars(unresolved: @mutable option<int>,
     }
 
     fn fixup_vars(typ: ty::t) -> fres<ty::t> {
-        let unresolved = @mutable none::<int>;
+        let unresolved = @mut none::<int>;
         let rty =
             ty::fold_ty(self.tcx,
                         ty::fm_var(
@@ -802,7 +802,7 @@ fn fixup_vars(typ: ty::t) -> fres<ty::t> {
         }
     }
 
-    fn subst_regions(unresolved: @mutable option<int>,
+    fn subst_regions(unresolved: @mut option<int>,
                      regions_seen: std::list::list<int>,
                      rid: int) -> ty::region {
         // Should really return a fixup_result instead of a t, but fold_ty
@@ -826,7 +826,7 @@ fn subst_regions(unresolved: @mutable option<int>,
     }
 
     fn fixup_regions(typ: ty::t) -> fres<ty::t> {
-        let unresolved = @mutable none::<int>;
+        let unresolved = @mut none::<int>;
         let rty = ty::fold_ty(self.tcx, ty::fm_rptr({ |region, _under_rptr|
             alt region {
               ty::re_var(rid) {
@@ -1346,8 +1346,8 @@ fn c_mts(a: ty::mt, b: ty::mt) -> cres<ty::mt> {
                mt_to_str(tcx, b));
 
         alt (a.mutbl, b.mutbl) {
-          // If one side or both is mutable, then the GLB must use
-          // the precise type from the mutable side.
+          // If one side or both is mut, then the GLB must use
+          // the precise type from the mut side.
           (ast::m_mutbl, ast::m_const) {
             self.infcx().tys(a.ty, b.ty).then {||
                 ok({ty: a.ty, mutbl: ast::m_mutbl})
index d4849abfb27f14a1a88b3a475093f8e292dfc6f5..aaa452a89c27f2ccdfe817bbf3c3c098d8c8ce57 100644 (file)
@@ -38,7 +38,7 @@ enum block_type { func, lp, }
 
 enum use { var_use(node_id), close_over(node_id), }
 type set = [{def: node_id, uses: list<use>}];
-type bl = @{type: block_type, mutable second: bool, mutable exits: [set]};
+type bl = @{type: block_type, mut second: bool, mut exits: [set]};
 
 enum use_id { path(node_id), close(node_id, node_id) }
 fn hash_use_id(id: use_id) -> uint {
@@ -51,8 +51,8 @@ fn hash_use_id(id: use_id) -> uint {
             ref_map: alias::ref_map,
             tcx: ty::ctxt,
             // The current set of local last uses
-            mutable current: set,
-            mutable blocks: list<bl>};
+            mut current: set,
+            mut blocks: list<bl>};
 
 fn find_last_uses(c: @crate, def_map: resolve::def_map,
                   ref_map: alias::ref_map, tcx: ty::ctxt)
@@ -66,8 +66,8 @@ fn find_last_uses(c: @crate, def_map: resolve::def_map,
               def_map: def_map,
               ref_map: ref_map,
               tcx: tcx,
-              mutable current: [],
-              mutable blocks: nil};
+              mut current: [],
+              mut blocks: nil};
     visit::visit_crate(*c, cx, v);
     let mini_table = std::map::int_hash();
     cx.last_uses.items {|key, val|
@@ -268,7 +268,7 @@ fn visit_fn(fk: visit::fn_kind, decl: fn_decl, body: blk,
 }
 
 fn visit_block(tp: block_type, cx: ctx, visit: fn()) {
-    let local = @{type: tp, mutable second: false, mutable exits: []};
+    let local = @{type: tp, mut second: false, mut exits: []};
     cx.blocks = cons(local, @cx.blocks);
     visit();
     local.second = true;
index 0c40305f14a626fc85fa02c05a73c666a8235ea5..092afcdbedde3a4ca073b8282e290ee8e6dcc1e9 100644 (file)
@@ -131,7 +131,7 @@ fn mk_err(cx: @ctx, span: syntax::codemap::span, msg: msg, name: str) {
     cx.tcx.sess.span_err(span, alt msg {
       msg_assign { "assigning to " + name }
       msg_move_out { "moving out of " + name }
-      msg_mutbl_ref { "passing " + name + " by mutable reference" }
+      msg_mutbl_ref { "passing " + name + " by mut reference" }
     });
 }
 
@@ -254,7 +254,7 @@ fn check_bind(cx: @ctx, f: @expr, args: [option<@expr>]) {
         alt arg {
           some(expr) {
             let o_msg = alt ty::resolved_mode(cx.tcx, arg_ts[i].mode) {
-              by_mutbl_ref { some("by mutable reference") }
+              by_mutbl_ref { some("by mut reference") }
               by_move { some("by move") }
               _ { none }
             };
index 9e9c28daf6aabdf9da2ba684ffd6fccead7f06cb..712ccbf02aff93adc4bdb57577e07d4d489ef599 100644 (file)
@@ -35,7 +35,7 @@ enum scope {
     scope_fn_expr(ast::fn_decl, node_id, [ast::ty_param]),
     scope_native_item(@ast::native_item),
     scope_loop(@ast::local), // there's only 1 decl per loop.
-    scope_block(ast::blk, @mutable uint, @mutable uint),
+    scope_block(ast::blk, @mut uint, @mut uint),
     scope_arm(ast::arm),
     scope_method(node_id, [ast::ty_param]),
 }
@@ -104,8 +104,8 @@ enum mod_index_entry {
 type indexed_mod = {
     m: option<ast::_mod>,
     index: mod_index,
-    mutable glob_imports: [glob_imp_def],
-    mutable globbed_exports: [ident],
+    mut glob_imports: [glob_imp_def],
+    mut globbed_exports: [ident],
     glob_imported_names: hashmap<str, glob_import_state>,
     path: str
 };
@@ -127,19 +127,19 @@ enum mod_index_entry {
      def_map: def_map,
      ast_map: ast_map::map,
      imports: hashmap<node_id, import_state>,
-     mutable exp_map: exp_map,
+     mut exp_map: exp_map,
      mod_map: hashmap<node_id, @indexed_mod>,
      block_map: hashmap<node_id, [glob_imp_def]>,
      ext_map: ext_map,
      impl_map: impl_map,
      impl_cache: impl_cache,
      ext_cache: ext_hash,
-     used_imports: {mutable track: bool,
-                    mutable data: [node_id]},
-     mutable reported: [{ident: str, sc: scope}],
-     mutable ignored_imports: [node_id],
-     mutable current_tp: option<uint>,
-     mutable resolve_unexported: bool,
+     used_imports: {mut track: bool,
+                    mut data: [node_id]},
+     mut reported: [{ident: str, sc: scope}],
+     mut ignored_imports: [node_id],
+     mut current_tp: option<uint>,
+     mut resolve_unexported: bool,
      sess: session};
 
 
@@ -171,18 +171,18 @@ fn create_env(sess: session, amap: ast_map::map) -> @env {
       def_map: int_hash(),
       ast_map: amap,
       imports: int_hash(),
-      mutable exp_map: int_hash(),
+      mut exp_map: int_hash(),
       mod_map: int_hash(),
       block_map: int_hash(),
       ext_map: new_def_hash(),
       impl_map: int_hash(),
       impl_cache: new_def_hash(),
       ext_cache: new_ext_hash(),
-      used_imports: {mutable track: false, mutable data:  []},
-      mutable reported: [],
-      mutable ignored_imports: [],
-      mutable current_tp: none,
-      mutable resolve_unexported: false,
+      used_imports: {mut track: false, mut data:  []},
+      mut reported: [],
+      mut ignored_imports: [],
+      mut current_tp: none,
+      mut resolve_unexported: false,
       sess: sess}
 }
 
@@ -268,8 +268,8 @@ fn index_i(e: @env, i: @ast::item, sc: scopes, v: vt<scopes>) {
             e.mod_map.insert(i.id,
                              @{m: some(md),
                                index: index_mod(md),
-                               mutable glob_imports: [],
-                               mutable globbed_exports: [],
+                               mut glob_imports: [],
+                               mut globbed_exports: [],
                                glob_imported_names: str_hash(),
                                path: path_from_scope(sc, i.ident)});
           }
@@ -277,8 +277,8 @@ fn index_i(e: @env, i: @ast::item, sc: scopes, v: vt<scopes>) {
             e.mod_map.insert(i.id,
                              @{m: none::<ast::_mod>,
                                index: index_nmod(nmd),
-                               mutable glob_imports: [],
-                               mutable globbed_exports: [],
+                               mut glob_imports: [],
+                               mut globbed_exports: [],
                                glob_imported_names: str_hash(),
                                path: path_from_scope(sc, i.ident)});
           }
@@ -336,8 +336,8 @@ fn link_glob(e: @env, vi: @ast::view_item, sc: scopes, _v: vt<scopes>) {
     e.mod_map.insert(ast::crate_node_id,
                      @{m: some(c.node.module),
                        index: index_mod(c.node.module),
-                       mutable glob_imports: [],
-                       mutable globbed_exports: [],
+                       mut glob_imports: [],
+                       mut globbed_exports: [],
                        glob_imported_names: str_hash(),
                        path: ""});
 
@@ -580,7 +580,7 @@ fn visit_fn_with_scope(e: @env, fk: visit::fn_kind, decl: ast::fn_decl,
 }
 
 fn visit_block_with_scope(b: ast::blk, sc: scopes, v: vt<scopes>) {
-    let pos = @mutable 0u, loc = @mutable 0u;
+    let pos = @mut 0u, loc = @mut 0u;
     let block_sc = cons(scope_block(b, pos, loc), @sc);
     for vi in b.node.view_items { v.visit_view_item(vi, block_sc, v); }
     for stmt in b.node.stmts {
@@ -594,7 +594,7 @@ fn visit_block_with_scope(b: ast::blk, sc: scopes, v: vt<scopes>) {
 fn visit_decl_with_scope(d: @decl, sc: scopes, v: vt<scopes>) {
     let loc_pos = alt list::head(sc) {
       scope_block(_, _, pos) { pos }
-      _ { @mutable 0u }
+      _ { @mut 0u }
     };
     alt d.node {
       decl_local(locs) {
@@ -1894,11 +1894,11 @@ fn check_ty(e: @env, ty: @ast::ty, &&x: (), v: vt<()>) {
     visit::visit_ty(ty, x, v);
 }
 
-type checker = @{mutable seen: [ident], kind: str, sess: session};
+type checker = @{mut seen: [ident], kind: str, sess: session};
 
 fn checker(e: env, kind: str) -> checker {
     let seen: [ident] = [];
-    ret @{mutable seen: seen, kind: kind, sess: e.sess};
+    ret @{mut seen: seen, kind: kind, sess: e.sess};
 }
 
 fn check_name(ch: checker, sp: span, name: ident) {
index 8b8ee1fe81b713a04448489b1407b47a08f469f8..352949109238b3260f83cb6ae8bd3770706b4877 100644 (file)
@@ -640,9 +640,9 @@ fn trans_alt_inner(scope_cx: block, expr: @ast::expr, arms: [ast::arm],
     let mk_fail = alt mode {
       ast::alt_check {
         // Cached fail-on-fallthrough block
-        let fail_cx = @mutable none;
+        let fail_cx = @mut none;
         fn mk_fail(bcx: block, sp: span,
-                   done: @mutable option<BasicBlockRef>) -> BasicBlockRef {
+                   done: @mut option<BasicBlockRef>) -> BasicBlockRef {
             alt *done { some(bb) { ret bb; } _ { } }
             let fail_cx = sub_block(bcx, "case_fallthrough");
             trans_fail(fail_cx, some(sp), "non-exhaustive match failure");;
index 35a73a0a530f06b9f3dd25966945e0293422d549..808a500814e65ffcae69fd322a9c8366d3411534 100644 (file)
@@ -56,7 +56,7 @@
 // destination of a computation's value.
 
 enum dest {
-    by_val(@mutable ValueRef),
+    by_val(@mut ValueRef),
     save_in(ValueRef),
     ignore,
 }
@@ -69,8 +69,8 @@ fn dest_str(ccx: @crate_ctxt, d: dest) -> str {
     }
 }
 
-fn empty_dest_cell() -> @mutable ValueRef {
-    ret @mutable llvm::LLVMGetUndef(T_nil());
+fn empty_dest_cell() -> @mut ValueRef {
+    ret @mut llvm::LLVMGetUndef(T_nil());
 }
 
 fn dup_for_join(dest: dest) -> dest {
@@ -454,9 +454,9 @@ fn declare_tydesc(ccx: @crate_ctxt, t: ty::t) -> @tydesc_info {
           tydesc: gvar,
           size: llsize,
           align: llalign,
-          mutable take_glue: none,
-          mutable drop_glue: none,
-          mutable free_glue: none};
+          mut take_glue: none,
+          mut drop_glue: none,
+          mut free_glue: none};
     log(debug, "--- declare_tydesc " + ty_to_str(ccx.tcx, t));
     ret info;
 }
@@ -3516,11 +3516,11 @@ fn new_block(cx: fn_ctxt, parent: block_parent, kind: block_kind,
         llvm::LLVMAppendBasicBlock(cx.llfn, buf)
     });
     let bcx = @{llbb: llbb,
-                mutable terminated: false,
-                mutable unreachable: false,
+                mut terminated: false,
+                mut unreachable: false,
                 parent: parent,
                 kind: kind,
-                mutable block_span: block_span,
+                mut block_span: block_span,
                 fcx: cx};
     alt parent {
       parent_some(cx) {
@@ -3532,8 +3532,8 @@ fn new_block(cx: fn_ctxt, parent: block_parent, kind: block_kind,
 }
 
 fn simple_block_scope() -> block_kind {
-    block_scope({is_loop: none, mutable cleanups: [],
-                 mutable cleanup_paths: [], mutable landing_pad: none})
+    block_scope({is_loop: none, mut cleanups: [],
+                 mut cleanup_paths: [], mut landing_pad: none})
 }
 
 // Use this when you're at the top block of a function or the like.
@@ -3552,9 +3552,9 @@ fn loop_scope_block(bcx: block, _cont: loop_cont,
     -> block {
     ret new_block(bcx.fcx, parent_some(bcx), block_scope({
         is_loop: some({cnt: _cont, brk: _break}),
-        mutable cleanups: [],
-        mutable cleanup_paths: [],
-        mutable landing_pad: none
+        mut cleanups: [],
+        mut cleanup_paths: [],
+        mut landing_pad: none
     }), n, some(sp));
 }
 
@@ -3566,11 +3566,11 @@ fn sub_block(bcx: block, n: str) -> block {
 
 fn raw_block(fcx: fn_ctxt, llbb: BasicBlockRef) -> block {
     ret @{llbb: llbb,
-          mutable terminated: false,
-          mutable unreachable: false,
+          mut terminated: false,
+          mut unreachable: false,
           parent: parent_none,
           kind: block_non_scope,
-          mutable block_span: none,
+          mut block_span: none,
           fcx: fcx};
 }
 
@@ -3775,11 +3775,11 @@ fn new_fn_ctxt_w_id(ccx: @crate_ctxt, path: path,
     ret @{llfn: llfndecl,
           llenv: llvm::LLVMGetParam(llfndecl, 1u as c_uint),
           llretptr: llvm::LLVMGetParam(llfndecl, 0u as c_uint),
-          mutable llstaticallocas: llbbs.sa,
-          mutable llloadenv: llbbs.ca,
-          mutable llreturn: llbbs.rt,
-          mutable llself: none,
-          mutable personality: none,
+          mut llstaticallocas: llbbs.sa,
+          mut llloadenv: llbbs.ca,
+          mut llreturn: llbbs.rt,
+          mut llself: none,
+          mut personality: none,
           llargs: int_hash::<local_val>(),
           lllocals: int_hash::<local_val>(),
           llupvars: int_hash::<ValueRef>(),
@@ -4766,7 +4766,7 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
           exp_map: emap,
           reachable: reachable,
           item_symbols: int_hash::<str>(),
-          mutable main_fn: none::<ValueRef>,
+          mut main_fn: none::<ValueRef>,
           link_meta: link_meta,
           enum_sizes: ty::new_ty_hash(),
           discrims: ast_util::new_def_id_hash::<ValueRef>(),
@@ -4786,13 +4786,13 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
           tcx: tcx,
           maps: maps,
           stats:
-              {mutable n_static_tydescs: 0u,
-               mutable n_glues_created: 0u,
-               mutable n_null_glues: 0u,
-               mutable n_real_glues: 0u,
-               llvm_insn_ctxt: @mutable [],
+              {mut n_static_tydescs: 0u,
+               mut n_glues_created: 0u,
+               mut n_null_glues: 0u,
+               mut n_real_glues: 0u,
+               llvm_insn_ctxt: @mut [],
                llvm_insns: str_hash(),
-               fn_times: @mutable []},
+               fn_times: @mut []},
           upcalls:
               upcall::declare_upcalls(targ_cfg, tn, tydesc_type,
                                       llmod),
@@ -4806,7 +4806,7 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
           crate_map: crate_map,
           dbg_cx: dbg_cx,
           class_ctors: int_hash::<int>(),
-          mutable do_not_commit_warning_issued: false};
+          mut do_not_commit_warning_issued: false};
 
 
     {
index 80c1895ed54d33d8cd711345b3ff06089584b711..f68495b756120ea165b9f3c66978e1e1eb554f1b 100644 (file)
@@ -22,7 +22,7 @@
 
 type namegen = fn@(str) -> str;
 fn new_namegen() -> namegen {
-    let i = @mutable 0;
+    let i = @mut 0;
     ret fn@(prefix: str) -> str { *i += 1; prefix + int::str(*i) };
 }
 
@@ -31,9 +31,9 @@ fn new_namegen() -> namegen {
      tydesc: ValueRef,
      size: ValueRef,
      align: ValueRef,
-     mutable take_glue: option<ValueRef>,
-     mutable drop_glue: option<ValueRef>,
-     mutable free_glue: option<ValueRef>};
+     mut take_glue: option<ValueRef>,
+     mut drop_glue: option<ValueRef>,
+     mut free_glue: option<ValueRef>};
 
 /*
  * A note on nomenclature of linking: "upcall", "extern" and "native".
@@ -52,13 +52,13 @@ fn new_namegen() -> namegen {
  */
 
 type stats =
-    {mutable n_static_tydescs: uint,
-     mutable n_glues_created: uint,
-     mutable n_null_glues: uint,
-     mutable n_real_glues: uint,
-     llvm_insn_ctxt: @mutable [str],
+    {mut n_static_tydescs: uint,
+     mut n_glues_created: uint,
+     mut n_null_glues: uint,
+     mut n_real_glues: uint,
+     llvm_insn_ctxt: @mut [str],
      llvm_insns: hashmap<str, uint>,
-     fn_times: @mutable [{ident: str, time: int}]};
+     fn_times: @mut [{ident: str, time: int}]};
 
 resource BuilderRef_res(B: BuilderRef) { llvm::LLVMDisposeBuilder(B); }
 
@@ -85,7 +85,7 @@ fn new_namegen() -> namegen {
      exp_map: resolve::exp_map,
      reachable: reachable::map,
      item_symbols: hashmap<ast::node_id, str>,
-     mutable main_fn: option<ValueRef>,
+     mut main_fn: option<ValueRef>,
      link_meta: link::link_meta,
      enum_sizes: hashmap<ty::t, uint>,
      discrims: hashmap<ast::def_id, ValueRef>,
@@ -122,7 +122,7 @@ fn new_namegen() -> namegen {
      // Mapping from class constructors to parent class --
      // used in base::trans_closure
      class_ctors: hashmap<ast::node_id, ast::node_id>,
-     mutable do_not_commit_warning_issued: bool};
+     mut do_not_commit_warning_issued: bool};
 
 // Types used for llself.
 type val_self_pair = {v: ValueRef, t: ty::t};
@@ -152,19 +152,19 @@ enum local_val { local_mem(ValueRef), local_imm(ValueRef), }
     // the function, due to LLVM's quirks.
     // A block for all the function's static allocas, so that LLVM
     // will coalesce them into a single alloca call.
-    mutable llstaticallocas: BasicBlockRef,
+    mut llstaticallocas: BasicBlockRef,
     // A block containing code that copies incoming arguments to space
     // already allocated by code in one of the llallocas blocks.
     // (LLVM requires that arguments be copied to local allocas before
     // allowing most any operation to be performed on them.)
-    mutable llloadenv: BasicBlockRef,
-    mutable llreturn: BasicBlockRef,
+    mut llloadenv: BasicBlockRef,
+    mut llreturn: BasicBlockRef,
     // The 'self' value currently in use in this function, if there
     // is one.
-    mutable llself: option<val_self_pair>,
+    mut llself: option<val_self_pair>,
     // The a value alloca'd for calls to upcalls.rust_personality. Used when
     // outputting the resume instruction.
-    mutable personality: option<ValueRef>,
+    mut personality: option<ValueRef>,
 
     // Maps arguments to allocas created for them in llallocas.
     llargs: hashmap<ast::node_id, local_val>,
@@ -294,12 +294,12 @@ enum loop_cont { cont_self, cont_other(block), }
     // A list of functions that must be run at when leaving this
     // block, cleaning up any variables that were introduced in the
     // block.
-    mutable cleanups: [cleanup],
+    mut cleanups: [cleanup],
     // Existing cleanup paths that may be reused, indexed by destination and
     // cleared when the set of cleanups changes.
-    mutable cleanup_paths: [cleanup_path],
+    mut cleanup_paths: [cleanup_path],
     // Unwinding landing pad. Also cleared when cleanups change.
-    mutable landing_pad: option<BasicBlockRef>,
+    mut landing_pad: option<BasicBlockRef>,
 };
 
 // Basic block context.  We create a block context for each basic block
@@ -314,14 +314,14 @@ enum loop_cont { cont_self, cont_other(block), }
     // instructions into that block by way of this block context.
     // The block pointing to this one in the function's digraph.
     llbb: BasicBlockRef,
-    mutable terminated: bool,
-    mutable unreachable: bool,
+    mut terminated: bool,
+    mut unreachable: bool,
     parent: block_parent,
     // The 'kind' of basic block this is.
     kind: block_kind,
     // The source span where the block came from, if it is a block that
     // actually appears in the source code.
-    mutable block_span: option<span>,
+    mut block_span: option<span>,
     // The function context for the function to which this block is
     // attached.
     fcx: fn_ctxt
index 0896f9000f1ca609c46e2979f69375a388dc82ec..cbca8f63a52c4450cfbe0b6753022eeb354d9eea 100644 (file)
@@ -366,8 +366,8 @@ fn create_pointer_type(cx: @crate_ctxt, t: ty::t, span: span,
     file: ValueRef,
     name: str,
     line: int,
-    mutable members: [ValueRef],
-    mutable total_size: int,
+    mut members: [ValueRef],
+    mut total_size: int,
     align: int
 };
 
@@ -382,8 +382,8 @@ fn create_structure(file: @metadata<file_md>, name: str, line: int)
     let cx = @{file: file.node,
                name: name,
                line: line,
-               mutable members: [],
-               mutable total_size: 0,
+               mut members: [],
+               mut total_size: 0,
                align: 64 //XXX different alignment per arch?
               };
     ret cx;
index bcf73ca97748a2f6d6cd7e1cc84ab5464b0d6cff..a81caf11b36109490d7895cdfb7fcb3125ae6cbd 100644 (file)
 type res_info = {did: ast::def_id, tps: [ty::t]};
 
 type ctxt =
-    {mutable next_tag_id: u16,
+    {mut next_tag_id: u16,
      pad: u16,
      tag_id_to_index: hashmap<ast::def_id, u16>,
-     mutable tag_order: [ast::def_id],
+     mut tag_order: [ast::def_id],
      resources: interner::interner<res_info>,
      llshapetablesty: TypeRef,
      llshapetables: ValueRef};
@@ -126,8 +126,8 @@ fn largest_variants(ccx: @crate_ctxt, tag_id: ast::def_id) -> [uint] {
     }
 
     // Initialize the candidate set to contain all variants.
-    let mut candidates = [mutable];
-    for variant in *variants { candidates += [mutable true]; }
+    let mut candidates = [mut];
+    for variant in *variants { candidates += [mut true]; }
 
     // Do a pairwise comparison among all variants still in the candidate set.
     // Throw out any variant that we know has size and alignment at least as
@@ -269,10 +269,10 @@ fn mk_ctxt(llmod: ModuleRef) -> ctxt {
         lib::llvm::llvm::LLVMAddGlobal(llmod, llshapetablesty, buf)
     });
 
-    ret {mutable next_tag_id: 0u16,
+    ret {mut next_tag_id: 0u16,
          pad: 0u16,
          tag_id_to_index: common::new_def_hash(),
-         mutable tag_order: [],
+         mut tag_order: [],
          resources: interner::mk(hash_res_info, {|a, b| a == b}),
          llshapetablesty: llshapetablesty,
          llshapetables: llshapetables};
index f347d4e33209494f58f974b7f1a54ffec6f34be1..61b09f0e01ccde0c11f7092b50eec83860811fc8 100644 (file)
@@ -29,7 +29,7 @@
 const use_tydesc: uint = 2u; // Takes the tydesc, or compares
 
 type ctx = {ccx: @crate_ctxt,
-            uses: [mutable type_uses]};
+            uses: [mut type_uses]};
 
 fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
     -> [type_uses] {
index d42716931124b6c0b635e0d61568db9201fa3919..3693f22d6e28244e51fd8b224a58fe9c3834e727 100644 (file)
@@ -7,11 +7,11 @@
 import ann::empty_ann;
 import pat_util::pat_binding_ids;
 
-fn collect_ids_expr(e: @expr, rs: @mutable [node_id]) { *rs += [e.id]; }
+fn collect_ids_expr(e: @expr, rs: @mut [node_id]) { *rs += [e.id]; }
 
-fn collect_ids_block(b: blk, rs: @mutable [node_id]) { *rs += [b.node.id]; }
+fn collect_ids_block(b: blk, rs: @mut [node_id]) { *rs += [b.node.id]; }
 
-fn collect_ids_stmt(s: @stmt, rs: @mutable [node_id]) {
+fn collect_ids_stmt(s: @stmt, rs: @mut [node_id]) {
     alt s.node {
       stmt_decl(_, id) | stmt_expr(_, id) | stmt_semi(_, id) {
         log(debug, "node_id " + int::str(id));
@@ -22,11 +22,11 @@ fn collect_ids_stmt(s: @stmt, rs: @mutable [node_id]) {
     }
 }
 
-fn collect_ids_local(tcx: ty::ctxt, l: @local, rs: @mutable [node_id]) {
+fn collect_ids_local(tcx: ty::ctxt, l: @local, rs: @mut [node_id]) {
     *rs += pat_binding_ids(tcx.def_map, l.node.pat);
 }
 
-fn node_ids_in_fn(tcx: ty::ctxt, body: blk, rs: @mutable [node_id]) {
+fn node_ids_in_fn(tcx: ty::ctxt, body: blk, rs: @mut [node_id]) {
     let collect_ids =
         visit::mk_simple_visitor(@{visit_expr: bind collect_ids_expr(_, rs),
                                    visit_block: bind collect_ids_block(_, rs),
@@ -45,7 +45,7 @@ fn init_vecs(ccx: crate_ctxt, node_ids: [node_id], len: uint) {
 }
 
 fn visit_fn(ccx: crate_ctxt, num_constraints: uint, body: blk) {
-    let node_ids: @mutable [node_id] = @mutable [];
+    let node_ids: @mut [node_id] = @mut [];
     node_ids_in_fn(ccx.tcx, body, node_ids);
     let node_id_vec = *node_ids;
     init_vecs(ccx, node_id_vec, num_constraints);
index c973d15b40d30ecd2b36d31cdfe77fe3e7ae1685..c568d1f0cfee563b1ee401251beb8900e6da22e9 100644 (file)
@@ -200,9 +200,9 @@ fn print_idents(&idents: [ident]) {
 enum constraint {
     cinit(uint, span, ident),
 
-    // FIXME: really only want it to be mutable during collect_locals.
+    // FIXME: really only want it to be mut during collect_locals.
     // freeze it after that.
-    cpred(@path, @mutable [pred_args]),
+    cpred(@path, @mut [pred_args]),
 }
 
 // An ninit variant has a node_id because it refers to a local var.
@@ -261,7 +261,7 @@ enum tsconstr {
      cf: ret_style,
      i_return: tsconstr,
      i_diverge: tsconstr,
-     used_vars: @mutable [node_id]};
+     used_vars: @mut [node_id]};
 
 fn tsconstr_to_def_id(t: tsconstr) -> def_id {
     alt t { ninit(id, _) { local_def(id) } npred(_, id, _) { id } }
@@ -275,7 +275,7 @@ fn tsconstr_to_node_id(t: tsconstr) -> node_id {
 }
 
 /* mapping from node ID to typestate annotation */
-type node_ann_table = @mutable [mutable ts_ann];
+type node_ann_table = @mut [mut ts_ann];
 
 
 /* mapping from function name to fn_info map */
@@ -483,8 +483,8 @@ fn pure_exp(ccx: crate_ctxt, id: node_id, p: prestate) -> bool {
 fn num_constraints(m: fn_info) -> uint { ret m.num_constraints; }
 
 fn new_crate_ctxt(cx: ty::ctxt) -> crate_ctxt {
-    let na: [mutable ts_ann] = [mutable];
-    ret {tcx: cx, node_anns: @mutable na, fm: int_hash::<fn_info>()};
+    let na: [mut ts_ann] = [mut];
+    ret {tcx: cx, node_anns: @mut na, fm: int_hash::<fn_info>()};
 }
 
 /* Use e's type to determine whether it returns.
@@ -549,7 +549,7 @@ fn constraints(fcx: fn_ctxt) -> [norm_constraint] {
 // FIXME
 // Would rather take an immutable vec as an argument,
 // should freeze it at some earlier point.
-fn match_args(fcx: fn_ctxt, occs: @mutable [pred_args],
+fn match_args(fcx: fn_ctxt, occs: @mut [pred_args],
               occ: [@constr_arg_use]) -> uint {
     #debug("match_args: looking at %s",
            constr_args_to_str(fn@(i: inst) -> str { ret i.ident; }, occ));
@@ -995,7 +995,7 @@ fn mentions<T>(&[T] s, &fn(&[T], def_id) -> bool q,
 fn use_var(fcx: fn_ctxt, v: node_id) { *fcx.enclosing.used_vars += [v]; }
 
 // FIXME: This should be a function in vec::.
-fn vec_contains(v: @mutable [node_id], i: node_id) -> bool {
+fn vec_contains(v: @mut [node_id], i: node_id) -> bool {
     for d: node_id in *v { if d == i { ret true; } }
     ret false;
 }
index c0532c8222f94bf9e5e984e4c90afe5031044fe5..90099df649272035715319311170fbc4a733fb59 100644 (file)
@@ -10,7 +10,7 @@
 import aux::*;
 import std::map::hashmap;
 
-type ctxt = {cs: @mutable [sp_constr], tcx: ty::ctxt};
+type ctxt = {cs: @mut [sp_constr], tcx: ty::ctxt};
 
 fn collect_local(loc: @local, cx: ctxt, v: visit::vt<ctxt>) {
     pat_bindings(cx.tcx.def_map, loc.node.pat) {|p_id, _s, id|
@@ -46,7 +46,7 @@ fn find_locals(tcx: ty::ctxt,
                f_body: blk,
                sp: span,
                id: node_id) -> ctxt {
-    let cx: ctxt = {cs: @mutable [], tcx: tcx};
+    let cx: ctxt = {cs: @mut [], tcx: tcx};
     let visitor = visit::default_visitor::<ctxt>();
     let visitor =
         @{visit_local: collect_local,
@@ -78,8 +78,8 @@ fn add_constraint(tcx: ty::ctxt, c: sp_constr, next: uint, tbl: constr_map) ->
             }
           }
           none {
-            let rslt: @mutable [pred_args] =
-                @mutable [respan(c.span, {args: args, bit_num: next})];
+            let rslt: @mut [pred_args] =
+                @mut [respan(c.span, {args: args, bit_num: next})];
             tbl.insert(d_id, cpred(p, rslt));
           }
         }
@@ -141,7 +141,7 @@ fn mk_fn_info(ccx: crate_ctxt,
     next = add_constraint(cx.tcx, respan(f_sp, diverges_constr), next,
                           res_map);
 
-    let v: @mutable [node_id] = @mutable [];
+    let v: @mut [node_id] = @mut [];
     let rslt =
         {constrs: res_map,
          num_constraints: next,
index deeef4f6826d5496e3ef3ce1e989126edf5f9dc0..a2796c942445927878e3d3d04093d3e3187d354b 100644 (file)
@@ -186,7 +186,7 @@ enum borrowing {
 
 type ctxt =
     @{interner: hashmap<intern_key, t_box>,
-      mutable next_id: uint,
+      mut next_id: uint,
       sess: session::session,
       def_map: resolve::def_map,
       region_map: @middle::region::region_map,
@@ -373,7 +373,7 @@ fn mk_ctxt(s: session::session, dm: resolve::def_map, amap: ast_map::map,
             option::maybe(k.o_def_id, 0u, ast_util::hash_def_id)
     }, {|&&a, &&b| a == b});
     @{interner: interner,
-      mutable next_id: 0u,
+      mut next_id: 0u,
       sess: s,
       def_map: dm,
       region_map: region_map,
@@ -1027,7 +1027,7 @@ fn type_structurally_contains(cx: ctxt, ty: t, test: fn(sty) -> bool) ->
 }
 
 // Returns true for noncopyable types and types where a copy of a value can be
-// distinguished from the value itself. I.e. types with mutable content that's
+// distinguished from the value itself. I.e. types with mut content that's
 // not shared through a pointer.
 fn type_allows_implicit_copy(cx: ctxt, ty: t) -> bool {
     ret !type_structurally_contains(cx, ty, {|sty|
@@ -2064,7 +2064,7 @@ fn class_field_tys(items: [@class_item]) -> [field_ty] {
 fn class_items_as_fields(cx:ctxt, did: ast::def_id) -> [field] {
     let mut rslt = [];
     for f in lookup_class_fields(cx, did) {
-       // consider all instance vars mutable, because the
+       // consider all instance vars mut, because the
        // constructor may mutate all vars
       rslt += [{ident: f.ident, mt: {ty: lookup_field_type(cx, did, f.id),
                   mutbl: m_mutbl}}];
index 8ef8841754c52223af3839fcd041def3e9ec2fa0..3fb2c67509a7d50532493963239927819668df82 100644 (file)
@@ -51,7 +51,7 @@ enum vtable_origin {
 // Used for typechecking the methods of an impl
 enum self_info { self_impl(ty::t) }
 
-type crate_ctxt = {mutable self_infos: [self_info],
+type crate_ctxt = {mut self_infos: [self_info],
                    impl_map: resolve::impl_map,
                    method_map: method_map,
                    vtable_map: vtable_map,
@@ -75,7 +75,7 @@ enum self_info { self_impl(ty::t) }
      proto: ast::proto,
      infcx: infer::infer_ctxt,
      locals: hashmap<ast::node_id, int>,
-     next_var_id: @mutable int,
+     next_var_id: @mut int,
      ccx: @crate_ctxt};
 
 
@@ -1244,13 +1244,13 @@ fn full(fcx: @fn_ctxt,
             ty_param_substs_0: [ty::t]) ->
        ty_param_substs_and_ty {
 
-        let mut ty_param_substs: [mutable ty::t] = [mutable];
+        let mut ty_param_substs: [mut ty::t] = [mut];
         let mut ty_param_subst_var_ids: [int] = [];
         for ty_param_subst: ty::t in ty_param_substs_0 {
             // Generate a type variable and unify it with the type parameter
             // substitution. We will then pull out these type variables.
             let t_0 = next_ty_var(fcx);
-            ty_param_substs += [mutable t_0];
+            ty_param_substs += [mut t_0];
             ty_param_subst_var_ids += [ty::ty_var_id(t_0)];
             simple(fcx, sp, ty_param_subst, t_0);
         }
@@ -1383,7 +1383,7 @@ fn resolve_type_vars_for_node(wbcx: wb_ctxt, sp: span, id: ast::node_id)
     type wb_ctxt =
         // As soon as we hit an error we have to stop resolving
         // the entire function
-        {fcx: @fn_ctxt, mutable success: bool};
+        {fcx: @fn_ctxt, mut success: bool};
     type wb_vt = visit::vt<wb_ctxt>;
 
     fn visit_stmt(s: @ast::stmt, wbcx: wb_ctxt, v: wb_vt) {
@@ -1461,7 +1461,7 @@ fn visit_item(_item: @ast::item, _wbcx: wb_ctxt, _v: wb_vt) {
     }
 
     fn resolve_type_vars_in_expr(fcx: @fn_ctxt, e: @ast::expr) -> bool {
-        let wbcx = {fcx: fcx, mutable success: true};
+        let wbcx = {fcx: fcx, mut success: true};
         let visit =
             visit::mk_vt(@{visit_item: visit_item,
                            visit_stmt: visit_stmt,
@@ -1475,7 +1475,7 @@ fn resolve_type_vars_in_expr(fcx: @fn_ctxt, e: @ast::expr) -> bool {
     }
 
     fn resolve_type_vars_in_block(fcx: @fn_ctxt, blk: ast::blk) -> bool {
-        let wbcx = {fcx: fcx, mutable success: true};
+        let wbcx = {fcx: fcx, mut success: true};
         let visit =
             visit::mk_vt(@{visit_item: visit_item,
                            visit_stmt: visit_stmt,
@@ -1536,7 +1536,7 @@ fn arg(m: ast::rmode, ty: ty::t) -> ty::arg {
 type gather_result =
     {infcx: infer::infer_ctxt,
      locals: hashmap<ast::node_id, int>,
-     next_var_id: @mutable int};
+     next_var_id: @mut int};
 
 // Used only as a helper for check_fn.
 fn gather_locals(ccx: @crate_ctxt,
@@ -1548,7 +1548,7 @@ fn gather_locals(ccx: @crate_ctxt,
       none {
         {infcx: infer::new_infer_ctxt(ccx.tcx),
          locals: int_hash::<int>(),
-         nvi: @mutable 0}
+         nvi: @mut 0}
       }
       some(fcx) {
         {infcx: fcx.infcx,
@@ -2544,7 +2544,7 @@ fn check_binop(fcx: @fn_ctxt, expr: @ast::expr,
             // const versions of the vectors in L and R.  Next, let T be a
             // fresh type variable where TL <: T and TR <: T.  Then the result
             // type is a fresh type variable T1 where T1 <: [const T].  This
-            // allows the result to be either a mutable or immutable vector,
+            // allows the result to be either a mut or immutable vector,
             // depending on external demands.
             let const_vec_t =
                 ty::mk_vec(tcx, {ty: next_ty_var(fcx),
@@ -3370,7 +3370,7 @@ fn check_const(ccx: @crate_ctxt, _sp: span, e: @ast::expr, id: ast::node_id) {
           proto: ast::proto_box,
           infcx: infer::new_infer_ctxt(ccx.tcx),
           locals: int_hash::<int>(),
-          next_var_id: @mutable 0,
+          next_var_id: @mut 0,
           ccx: ccx};
     check_expr(fcx, e);
     let cty = expr_ty(fcx.ccx.tcx, e);
@@ -3389,7 +3389,7 @@ fn check_enum_variants(ccx: @crate_ctxt, sp: span, vs: [ast::variant],
           proto: ast::proto_box,
           infcx: infer::new_infer_ctxt(ccx.tcx),
           locals: int_hash::<int>(),
-          next_var_id: @mutable 0,
+          next_var_id: @mut 0,
           ccx: ccx};
     let mut disr_vals: [int] = [];
     let mut disr_val = 0;
@@ -3950,7 +3950,7 @@ fn check_crate(tcx: ty::ctxt, impl_map: resolve::impl_map,
                crate: @ast::crate) -> (method_map, vtable_map) {
     collect::collect_item_types(tcx, crate);
 
-    let ccx = @{mutable self_infos: [],
+    let ccx = @{mut self_infos: [],
                 impl_map: impl_map,
                 method_map: std::map::int_hash(),
                 vtable_map: std::map::int_hash(),
index 1f0b40925bcd0b9c4dd23ef2643546854d42d00d..217977e96588eb960cae39bf309bb2f58e0754fe 100644 (file)
@@ -86,7 +86,7 @@ enum def {
     // first def_id is for parent class
     def_class_field(def_id, def_id),
     // No purity allowed for now, I guess
-    // (simpler this way, b/c presumably methods read mutable state)
+    // (simpler this way, b/c presumably methods read mut state)
     def_class_method(def_id, def_id),
     def_region(node_id)
 }
index c242b142bcc7546ac4fa9376feeb4a5bb4e03cb9..a1a117201fb29aae99682bfcffc38ce238ce1784 100644 (file)
@@ -16,13 +16,13 @@ enum file_substr {
 
 type filemap =
     @{name: filename, substr: file_substr, src: @str,
-      start_pos: file_pos, mutable lines: [file_pos]};
+      start_pos: file_pos, mut lines: [file_pos]};
 
-type codemap = @{mutable files: [filemap]};
+type codemap = @{mut files: [filemap]};
 
 type loc = {file: filemap, line: uint, col: uint};
 
-fn new_codemap() -> codemap { @{mutable files: [] } }
+fn new_codemap() -> codemap { @{mut files: [] } }
 
 fn new_filemap_w_substr(filename: filename, substr: file_substr,
                         src: @str,
@@ -30,7 +30,7 @@ fn new_filemap_w_substr(filename: filename, substr: file_substr,
    -> filemap {
     ret @{name: filename, substr: substr, src: src,
           start_pos: {ch: start_pos_ch, byte: start_pos_byte},
-          mutable lines: [{ch: start_pos_ch, byte: start_pos_byte}]};
+          mut lines: [{ch: start_pos_ch, byte: start_pos_byte}]};
 }
 
 fn new_filemap(filename: filename, src: @str,
index 01da22e38a1620241310c3686d56a51e9d766b27..86f13822c6e63c06f43f165d0921ef3ac8427e53 100644 (file)
@@ -67,7 +67,7 @@ fn mk_ctxt(session: driver::session::session,
     type ctxt_repr = {session: driver::session::session,
                       parse_sess: parser::parse_sess,
                       cfg: ast::crate_cfg,
-                      mutable backtrace: expn_info};
+                      mut backtrace: expn_info};
     impl of ext_ctxt for ctxt_repr {
         fn session() -> driver::session::session { self.session }
         fn codemap() -> codemap { self.parse_sess.cm }
@@ -122,7 +122,7 @@ fn next_id() -> ast::node_id {
         session: session,
         parse_sess: parse_sess,
         cfg: cfg,
-        mutable backtrace: none
+        mut backtrace: none
     };
     ret imp as ext_ctxt
 }
index ce65d460f30fa6aae8422b484f9c69f2c34af5f6..50d70ffa8d0020c54716dbb61a2760bc1dbad2d7 100644 (file)
@@ -13,7 +13,7 @@
 import codemap::span;
 
 type aq_ctxt = @{lo: uint,
-                 mutable gather: [{lo: uint, hi: uint,
+                 mut gather: [{lo: uint, hi: uint,
                                    e: @ast::expr,
                                    constr: str}]};
 enum fragment {
@@ -99,7 +99,7 @@ fn gather_anti_quotes<N: qq_helper>(lo: uint, node: N) -> aq_ctxt
     let v = @{visit_expr: visit_aq_expr,
               visit_ty: visit_aq_ty
               with *default_visitor()};
-    let cx = @{lo:lo, mutable gather: []};
+    let cx = @{lo:lo, mut gather: []};
     node.visit(cx, mk_vt(v));
     // FIXME: Maybe this is an overkill (merge_sort), it might be better
     //   to just keep the gather array in sorted order ...
index 2223c5f0fd672a244742684a24527f4050b802dc..dfc7d5314fc6b6322f03e304c6f48a680b27f2e9 100644 (file)
@@ -136,7 +136,7 @@ fn scomp(s1: selector, s2: selector, m: matchable) -> match_result {
 
 type binders =
     {real_binders: hashmap<ident, selector>,
-     mutable literal_ast_matchers: [selector]};
+     mut literal_ast_matchers: [selector]};
 type bindings = hashmap<ident, arb_depth<matchable>>;
 
 fn acumm_bindings(_cx: ext_ctxt, _b_dest: bindings, _b_src: bindings) { }
@@ -148,7 +148,7 @@ fn acumm_bindings(_cx: ext_ctxt, _b_dest: bindings, _b_src: bindings) { }
 fn pattern_to_selectors(cx: ext_ctxt, e: @expr) -> binders {
     let res: binders =
         {real_binders: str_hash::<selector>(),
-         mutable literal_ast_matchers: []};
+         mut literal_ast_matchers: []};
     //this oughta return binders instead, but macro args are a sequence of
     //expressions, rather than a single expression
     fn trivial_selector(m: matchable) -> match_result { ret some(leaf(m)); }
@@ -183,7 +183,7 @@ fn use_selectors_to_bind(b: binders, e: @expr) -> option<bindings> {
 /* use the bindings on the body to generate the expanded code */
 
 fn transcribe(cx: ext_ctxt, b: bindings, body: @expr) -> @expr {
-    let idx_path: @mutable [uint] = @mutable [];
+    let idx_path: @mut [uint] = @mut [];
     fn new_id(_old: node_id, cx: ext_ctxt) -> node_id { ret cx.next_id(); }
     fn new_span(cx: ext_ctxt, sp: span) -> span {
         /* this discards information in the case of macro-defining macros */
@@ -208,7 +208,7 @@ fn new_span(cx: ext_ctxt, sp: span) -> span {
 
 
 /* helper: descend into a matcher */
-fn follow(m: arb_depth<matchable>, idx_path: @mutable [uint]) ->
+fn follow(m: arb_depth<matchable>, idx_path: @mut [uint]) ->
    arb_depth<matchable> {
     let mut res: arb_depth<matchable> = m;
     for idx: uint in *idx_path {
@@ -221,7 +221,7 @@ fn follow(m: arb_depth<matchable>, idx_path: @mutable [uint]) ->
 }
 
 fn follow_for_trans(cx: ext_ctxt, mmaybe: option<arb_depth<matchable>>,
-                    idx_path: @mutable [uint]) -> option<matchable> {
+                    idx_path: @mut [uint]) -> option<matchable> {
     alt mmaybe {
       none { ret none }
       some(m) {
@@ -258,7 +258,7 @@ fn mark_ident(&&i: ident, _fld: ast_fold, b: bindings,
 
 
 /* handle sequences (anywhere in the AST) of exprs, either real or ...ed */
-fn transcribe_exprs(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
+fn transcribe_exprs(cx: ext_ctxt, b: bindings, idx_path: @mut [uint],
                     recur: fn@(&&@expr) -> @expr, exprs: [@expr]) -> [@expr] {
     alt elts_to_ell(cx, exprs) {
       {pre: pre, rep: repeat_me_maybe, post: post} {
@@ -320,7 +320,7 @@ fn transcribe_exprs(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
 
 
 // substitute, in a position that's required to be an ident
-fn transcribe_ident(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
+fn transcribe_ident(cx: ext_ctxt, b: bindings, idx_path: @mut [uint],
                     &&i: ident, _fld: ast_fold) -> ident {
     ret alt follow_for_trans(cx, b.find(i), idx_path) {
           some(match_ident(a_id)) { a_id.node }
@@ -330,7 +330,7 @@ fn transcribe_ident(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
 }
 
 
-fn transcribe_path(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
+fn transcribe_path(cx: ext_ctxt, b: bindings, idx_path: @mut [uint],
                    p: path_, s:span, _fld: ast_fold) -> (path_, span) {
     // Don't substitute into qualified names.
     if vec::len(p.types) > 0u || vec::len(p.idents) != 1u { ret (p, s); }
@@ -345,7 +345,7 @@ fn transcribe_path(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
 }
 
 
-fn transcribe_expr(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
+fn transcribe_expr(cx: ext_ctxt, b: bindings, idx_path: @mut [uint],
                    e: ast::expr_, s: span, fld: ast_fold,
                    orig: fn@(ast::expr_, span, ast_fold)->(ast::expr_, span))
     -> (ast::expr_, span)
@@ -373,7 +373,7 @@ fn transcribe_expr(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
         }
 }
 
-fn transcribe_type(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
+fn transcribe_type(cx: ext_ctxt, b: bindings, idx_path: @mut [uint],
                    t: ast::ty_, s: span, fld: ast_fold,
                    orig: fn@(ast::ty_, span, ast_fold) -> (ast::ty_, span))
     -> (ast::ty_, span)
@@ -399,7 +399,7 @@ fn transcribe_type(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
 /* for parsing reasons, syntax variables bound to blocks must be used like
 `{v}` */
 
-fn transcribe_block(cx: ext_ctxt, b: bindings, idx_path: @mutable [uint],
+fn transcribe_block(cx: ext_ctxt, b: bindings, idx_path: @mut [uint],
                     blk: blk_, s: span, fld: ast_fold,
                     orig: fn@(blk_, span, ast_fold) -> (blk_, span))
     -> (blk_, span)
index ad649b28190c392e8663bc856d8591e40af71245..4630b99eda6d84a546185a4245637110bec5c93f 100644 (file)
@@ -15,7 +15,7 @@
 export wrap;
 export fold_ty_param;
 
-type ast_fold = @mutable a_f;
+type ast_fold = @mut a_f;
 
 // We may eventually want to be able to fold over type parameters, too
 
@@ -602,9 +602,9 @@ fn default_ast_fold() -> @ast_fold_precursor {
 
 fn make_fold(afp: ast_fold_precursor) -> ast_fold {
     // FIXME: Have to bind all the bare functions into shared functions
-    // because @mutable is invariant with respect to its contents
+    // because @mut is invariant with respect to its contents
     let result: ast_fold =
-        @mutable {fold_crate: bind nf_crate_dummy(_),
+        @mut {fold_crate: bind nf_crate_dummy(_),
                   fold_crate_directive: bind nf_crate_directive_dummy(_),
                   fold_view_item: bind nf_view_item_dummy(_),
                   fold_native_item: bind nf_native_item_dummy(_),
index 9b4387135d1e36252d920ec196118ad138fdbff6..5613b736d069de0919ff7dba1ffe96139f3c3c95 100644 (file)
@@ -8,11 +8,11 @@
     span_diagnostic: diagnostic::span_handler,
     src: @str,
     len: uint,
-    mutable col: uint,
-    mutable pos: uint,
-    mutable curr: char,
-    mutable chpos: uint,
-    mutable strs: [str],
+    mut col: uint,
+    mut pos: uint,
+    mut curr: char,
+    mut chpos: uint,
+    mut strs: [str],
     filemap: codemap::filemap,
     interner: @interner::interner<str>
 };
@@ -63,8 +63,8 @@ fn new_reader(cm: codemap::codemap,
     let r = @{cm: cm,
               span_diagnostic: span_diagnostic,
               src: filemap.src, len: str::len(*filemap.src),
-              mutable col: 0u, mutable pos: 0u, mutable curr: -1 as char,
-              mutable chpos: filemap.start_pos.ch, mutable strs: [],
+              mut col: 0u, mut pos: 0u, mut curr: -1 as char,
+              mut chpos: filemap.start_pos.ch, mut strs: [],
               filemap: filemap, interner: itr};
     if r.pos < r.len {
         let next = str::char_range_at(*r.src, r.pos);
index b35b68ea5e24253b0612b63d5fdfc3ef47ab80ce..78d8d2b6133ad63d24afae898ef5a99e3e84a822 100644 (file)
@@ -21,11 +21,11 @@ enum file_type { CRATE_FILE, SOURCE_FILE, }
 
 type parse_sess = @{
     cm: codemap::codemap,
-    mutable next_id: node_id,
+    mut next_id: node_id,
     span_diagnostic: diagnostic::span_handler,
     // these two must be kept up to date
-    mutable chpos: uint,
-    mutable byte_pos: uint
+    mut chpos: uint,
+    mut byte_pos: uint
 };
 
 fn next_node_id(sess: parse_sess) -> node_id {
@@ -40,11 +40,11 @@ fn next_node_id(sess: parse_sess) -> node_id {
     sess: parse_sess,
     cfg: ast::crate_cfg,
     file_type: file_type,
-    mutable token: token::token,
-    mutable span: span,
-    mutable last_span: span,
-    mutable buffer: [{tok: token::token, span: span}],
-    mutable restriction: restriction,
+    mut token: token::token,
+    mut span: span,
+    mut last_span: span,
+    mut buffer: [{tok: token::token, span: span}],
+    mut restriction: restriction,
     reader: reader,
     precs: @[op_spec],
     bad_expr_words: hashmap<str, ()>
@@ -130,11 +130,11 @@ fn new_parser(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader,
     @{sess: sess,
       cfg: cfg,
       file_type: ftype,
-      mutable token: tok0.tok,
-      mutable span: span0,
-      mutable last_span: span0,
-      mutable buffer: [],
-      mutable restriction: UNRESTRICTED,
+      mut token: tok0.tok,
+      mut span: span0,
+      mut last_span: span0,
+      mut buffer: [],
+      mut restriction: UNRESTRICTED,
       reader: rdr,
       precs: prec_table(),
       bad_expr_words: bad_expr_word_table()}
@@ -149,7 +149,7 @@ fn bad_expr_word_table() -> hashmap<str, ()> {
                  "class", "const", "cont", "copy", "crust", "do", "else",
                  "enum", "export", "fail", "fn", "for", "if",  "iface",
                  "impl", "import", "let", "log", "loop", "mod", "mut",
-                 "mutable", "native", "pure", "resource", "ret", "trait",
+                 "mut", "native", "pure", "resource", "ret", "trait",
                  "type", "unchecked", "unsafe", "while", "new"] {
         words.insert(word, ());
     }
@@ -735,7 +735,7 @@ fn parse_path_and_ty_param_substs(p: parser, colons: bool) -> @ast::path {
 }
 
 fn parse_mutability(p: parser) -> ast::mutability {
-    if eat_word(p, "mutable") {
+    if eat_word(p, "mut") {
         ast::m_mutbl
     } else if eat_word(p, "mut") {
         ast::m_mutbl
@@ -831,7 +831,7 @@ fn parse_bottom_expr(p: parser) -> pexpr {
         ret mk_pexpr(p, lo, hi, ast::expr_tup(es));
     } else if p.token == token::LBRACE {
         p.bump();
-        if is_word(p, "mut") || is_word(p, "mutable") ||
+        if is_word(p, "mut") ||
                is_plain_ident(p) && p.look_ahead(1u) == token::COLON {
             let mut fields = [parse_field(p, token::COLON)];
             let mut base = none;
@@ -1660,7 +1660,7 @@ fn parse_let(p: parser) -> @ast::decl {
 fn parse_instance_var(p:parser) -> (ast::class_member, codemap::span) {
     let mut is_mutbl = ast::class_immutable;
     let lo = p.span.lo;
-    if eat_word(p, "mut") || eat_word(p, "mutable") {
+    if eat_word(p, "mut") {
             is_mutbl = ast::class_mutable;
     }
     if !is_plain_ident(p) {
index bb71268870d9ec33684f9cdf7dfd70c39727b9a6..f116bab4fe48a95935e8920d0cb04ca629ea72fc 100644 (file)
@@ -70,7 +70,7 @@ fn tok_str(t: token) -> str {
     }
 }
 
-fn buf_str(toks: [mutable token], szs: [mutable int], left: uint, right: uint,
+fn buf_str(toks: [mut token], szs: [mut int], left: uint, right: uint,
            lim: uint) -> str {
     let n = vec::len(toks);
     assert (n == vec::len(szs));
@@ -99,26 +99,26 @@ fn mk_printer(out: io::writer, linewidth: uint) -> printer {
     // fall behind.
     let n: uint = 3u * linewidth;
     #debug("mk_printer %u", linewidth);
-    let token: [mutable token] = vec::to_mut(vec::from_elem(n, EOF));
-    let size: [mutable int] = vec::to_mut(vec::from_elem(n, 0));
-    let scan_stack: [mutable uint] = vec::to_mut(vec::from_elem(n, 0u));
+    let token: [mut token] = vec::to_mut(vec::from_elem(n, EOF));
+    let size: [mut int] = vec::to_mut(vec::from_elem(n, 0));
+    let scan_stack: [mut uint] = vec::to_mut(vec::from_elem(n, 0u));
     let print_stack: [print_stack_elt] = [];
     @{out: out,
       buf_len: n,
-      mutable margin: linewidth as int,
-      mutable space: linewidth as int,
-      mutable left: 0u,
-      mutable right: 0u,
-      mutable token: token,
-      mutable size: size,
-      mutable left_total: 0,
-      mutable right_total: 0,
-      mutable scan_stack: scan_stack,
-      mutable scan_stack_empty: true,
-      mutable top: 0u,
-      mutable bottom: 0u,
-      mutable print_stack: print_stack,
-      mutable pending_indentation: 0}
+      mut margin: linewidth as int,
+      mut space: linewidth as int,
+      mut left: 0u,
+      mut right: 0u,
+      mut token: token,
+      mut size: size,
+      mut left_total: 0,
+      mut right_total: 0,
+      mut scan_stack: scan_stack,
+      mut scan_stack_empty: true,
+      mut top: 0u,
+      mut bottom: 0u,
+      mut print_stack: print_stack,
+      mut pending_indentation: 0}
 }
 
 
@@ -202,28 +202,28 @@ fn mk_printer(out: io::writer, linewidth: uint) -> printer {
 type printer = @{
     out: io::writer,
     buf_len: uint,
-    mutable margin: int, // width of lines we're constrained to
-    mutable space: int, // number of spaces left on line
-    mutable left: uint, // index of left side of input stream
-    mutable right: uint, // index of right side of input stream
-    mutable token: [mutable token], // ring-buffr stream goes through
-    mutable size: [mutable int], // ring-buffer of calculated sizes
-    mutable left_total: int, // running size of stream "...left"
-    mutable right_total: int, // running size of stream "...right"
+    mut margin: int, // width of lines we're constrained to
+    mut space: int, // number of spaces left on line
+    mut left: uint, // index of left side of input stream
+    mut right: uint, // index of right side of input stream
+    mut token: [mut token], // ring-buffr stream goes through
+    mut size: [mut int], // ring-buffer of calculated sizes
+    mut left_total: int, // running size of stream "...left"
+    mut right_total: int, // running size of stream "...right"
     // pseudo-stack, really a ring too. Holds the
     // primary-ring-buffers index of the BEGIN that started the
     // current block, possibly with the most recent BREAK after that
     // BEGIN (if there is any) on top of it. Stuff is flushed off the
     // bottom as it becomes irrelevant due to the primary ring-buffer
     // advancing.
-    mutable scan_stack: [mutable uint],
-    mutable scan_stack_empty: bool, // top==bottom disambiguator
-    mutable top: uint, // index of top of scan_stack
-    mutable bottom: uint, // index of bottom of scan_stack
+    mut scan_stack: [mut uint],
+    mut scan_stack_empty: bool, // top==bottom disambiguator
+    mut top: uint, // index of top of scan_stack
+    mut bottom: uint, // index of bottom of scan_stack
     // stack of blocks-in-progress being flushed by print
-    mutable print_stack: [print_stack_elt],
+    mut print_stack: [print_stack_elt],
     // buffered indentation to avoid writing trailing whitespace
-    mutable pending_indentation: int
+    mut pending_indentation: int
 };
 
 impl printer for printer {
index 76f9f8527f416041e5b0a657d46fcd5ae29d9819..071441fe8e879f8565e4501750bd81c750e34c20 100644 (file)
@@ -24,9 +24,9 @@ fn ignore(_node: ann_node) { }
       cm: option<codemap>,
       comments: option<[lexer::cmnt]>,
       literals: option<[lexer::lit]>,
-      mutable cur_cmnt: uint,
-      mutable cur_lit: uint,
-      mutable boxes: [pp::breaks],
+      mut cur_cmnt: uint,
+      mut cur_lit: uint,
+      mut boxes: [pp::breaks],
       ann: pp_ann};
 
 fn ibox(s: ps, u: uint) { s.boxes += [pp::inconsistent]; pp::ibox(s.s, u); }
@@ -39,9 +39,9 @@ fn rust_printer(writer: io::writer) -> ps {
           cm: none::<codemap>,
           comments: none::<[lexer::cmnt]>,
           literals: none::<[lexer::lit]>,
-          mutable cur_cmnt: 0u,
-          mutable cur_lit: 0u,
-          mutable boxes: boxes,
+          mut cur_cmnt: 0u,
+          mut cur_lit: 0u,
+          mut boxes: boxes,
           ann: no_ann()};
 }
 
@@ -64,9 +64,9 @@ fn print_crate(cm: codemap, span_diagnostic: diagnostic::span_handler,
           cm: some(cm),
           comments: some(r.cmnts),
           literals: some(r.lits),
-          mutable cur_cmnt: 0u,
-          mutable cur_lit: 0u,
-          mutable boxes: boxes,
+          mut cur_cmnt: 0u,
+          mut cur_lit: 0u,
+          mut boxes: boxes,
           ann: ann};
     print_crate_(s, crate);
 }
@@ -518,7 +518,7 @@ fn print_item(s: ps, &&item: @ast::item) {
                  ast::instance_var(nm, t, mt, _) {
                     word_nbsp(s, "let");
                     alt mt {
-                      ast::class_mutable { word_nbsp(s, "mutable"); }
+                      ast::class_mutable { word_nbsp(s, "mut"); }
                       _ {}
                     }
                     word(s.s, nm);
@@ -818,7 +818,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
         ibox(s, indent_unit);
         word(s.s, "[");
         if mutbl == ast::m_mutbl {
-            word(s.s, "mutable");
+            word(s.s, "mut");
             if vec::len(exprs) > 0u { nbsp(s); }
         }
         commasep_exprs(s, inconsistent, exprs);
@@ -828,7 +828,7 @@ fn print_expr(s: ps, &&expr: @ast::expr) {
       ast::expr_rec(fields, wth) {
         fn print_field(s: ps, field: ast::field) {
             ibox(s, indent_unit);
-            if field.node.mutbl == ast::m_mutbl { word_nbsp(s, "mutable"); }
+            if field.node.mutbl == ast::m_mutbl { word_nbsp(s, "mut"); }
             word(s.s, field.node.ident);
             word_space(s, ":");
             print_expr(s, field.node.expr);
@@ -1135,7 +1135,7 @@ fn print_decl(s: ps, decl: @ast::decl) {
         ibox(s, indent_unit);
         word_nbsp(s, "let");
 
-        // if any are mutable, all are mutable
+        // if any are mut, all are mut
         if vec::any(locs) {|l| l.node.is_mutbl } {
             assert vec::all(locs) {|l| l.node.is_mutbl };
             word_nbsp(s, "mut");
@@ -1493,7 +1493,7 @@ fn print_op_maybe_parens(s: ps, expr: @ast::expr, outer_prec: int) {
 
 fn print_mutability(s: ps, mutbl: ast::mutability) {
     alt mutbl {
-      ast::m_mutbl { word_nbsp(s, "mutable"); }
+      ast::m_mutbl { word_nbsp(s, "mut"); }
       ast::m_const { word_nbsp(s, "const"); }
       ast::m_imm {/* nothing */ }
     }
index 65f52b2fc46465d6bd582888917fc30b8cadf125..99a032aae9450c8c749ea94d5d04a687ceebec8d 100644 (file)
@@ -6,13 +6,13 @@
 
 type interner<T> =
     {map: hashmap<T, uint>,
-     mutable vect: [T],
+     mut vect: [T],
      hasher: hashfn<T>,
      eqer: eqfn<T>};
 
 fn mk<T: copy>(hasher: hashfn<T>, eqer: eqfn<T>) -> interner<T> {
     let m = map::hashmap::<T, uint>(hasher, eqer);
-    ret {map: m, mutable vect: [], hasher: hasher, eqer: eqer};
+    ret {map: m, mut vect: [], hasher: hasher, eqer: eqer};
 }
 
 fn intern<T: copy>(itr: interner<T>, val: T) -> uint {
index 93c328ef2abc85f7dd1963e063fb631e687f4339..1a6b7b0ccf956a1a1b02cf5d06cf4b875d727237 100644 (file)
@@ -68,8 +68,8 @@ fn log_stmt_err(st: ast::stmt) {
 }
 
 fn has_nonlocal_exits(b: ast::blk) -> bool {
-    let has_exits = @mutable false;
-    fn visit_expr(flag: @mutable bool, e: @ast::expr) {
+    let has_exits = @mut false;
+    fn visit_expr(flag: @mut bool, e: @ast::expr) {
         alt e.node {
           ast::expr_break { *flag = true; }
           ast::expr_cont { *flag = true; }
@@ -85,8 +85,8 @@ fn visit_expr(flag: @mutable bool, e: @ast::expr) {
 
 /* FIXME: copy/paste, yuck */
 fn may_break(b: ast::blk) -> bool {
-    let has_exits = @mutable false;
-    fn visit_expr(flag: @mutable bool, e: @ast::expr) {
+    let has_exits = @mut false;
+    fn visit_expr(flag: @mut bool, e: @ast::expr) {
         alt e.node {
           ast::expr_break { *flag = true; }
           _ { }
index 83044447ec6b3c2860713a967d99baf6d69b4983..9bed75107fb5f6870857b369bf4c42dc728e6a9d 100644 (file)
@@ -104,7 +104,7 @@ fn exec<T:send>(
 }
 
 fn build_ctxt(sess: session::session, ast: @ast::crate,
-              ignore_errors: @mutable bool) -> ctxt {
+              ignore_errors: @mut bool) -> ctxt {
 
     import rustc::front::config;
 
@@ -125,7 +125,7 @@ fn build_ctxt(sess: session::session, ast: @ast::crate,
 
 // FIXME: this whole structure should not be duplicated here. makes it
 // painful to add or remove options.
-fn build_session() -> (session::session, @mutable bool) {
+fn build_session() -> (session::session, @mut bool) {
     let sopts: @session::options = @{
         crate_type: session::lib_crate,
         static: false,
@@ -163,7 +163,7 @@ fn build_session() -> (session::session, @mutable bool) {
 type error_handlers = {
     emitter: diagnostic::emitter,
     span_handler: diagnostic::span_handler,
-    ignore_errors: @mutable bool
+    ignore_errors: @mut bool
 };
 
 // Build a custom error handler that will allow us to ignore non-fatal
@@ -174,7 +174,7 @@ fn build_error_handlers(
 
     type diagnostic_handler = {
         inner: diagnostic::handler,
-        ignore_errors: @mutable bool
+        ignore_errors: @mut bool
     };
 
     impl of diagnostic::handler for diagnostic_handler {
@@ -197,7 +197,7 @@ fn emit(cmsp: option<(codemap::codemap, codemap::span)>,
         }
     }
 
-    let ignore_errors = @mutable false;
+    let ignore_errors = @mut false;
     let emitter = fn@(cmsp: option<(codemap::codemap, codemap::span)>,
                        msg: str, lvl: diagnostic::level) {
         if !(*ignore_errors) {
index 4e53151bf9a337bca020f68f48e5ad98e2979ffb..d410e3d3ab86fee4da5a04bf6cb395ca0e614063 100644 (file)
@@ -29,10 +29,10 @@ fn parse_attributes(source: str) -> [ast::attribute] {
         let handler = diagnostic::mk_handler(none);
         let parse_sess = @{
             cm: cm,
-            mutable next_id: 0,
+            mut next_id: 0,
             span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-            mutable chpos: 0u,
-            mutable byte_pos: 0u
+            mut chpos: 0u,
+            mut byte_pos: 0u
         };
         let parser = parser::new_parser_from_source_str(
             parse_sess, [], "-", codemap::fss_none, @source);
index c8b13d92769e755d85ee0ba47ae6b75afdfd5ac7..a52b3271886184045bd152bd1aca6fef59a3d4c7 100644 (file)
@@ -14,10 +14,10 @@ fn new_parse_sess() -> parser::parse_sess {
     let handler = diagnostic::mk_handler(none);
     let sess = @{
         cm: cm,
-        mutable next_id: 1,
+        mut next_id: 1,
         span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-        mutable chpos: 0u,
-        mutable byte_pos: 0u
+        mut chpos: 0u,
+        mut byte_pos: 0u
     };
     ret sess;
 }
index 9aa8877482206fc5fcb3816f32874f171a082a77..e92845712a2507591d9284e896bdd1570a4e0737 100644 (file)
@@ -11,13 +11,13 @@ fn mk_pass() -> pass {
 
 type ctxt = {
     srv: astsrv::srv,
-    mutable path: [str]
+    mut path: [str]
 };
 
 fn run(srv: astsrv::srv, doc: doc::doc) -> doc::doc {
     let ctxt = {
         srv: srv,
-        mutable path: []
+        mut path: []
     };
     let fold = fold::fold({
         fold_item: fold_item,
diff --git a/src/rustdoc/rustdoc b/src/rustdoc/rustdoc
new file mode 100755 (executable)
index 0000000..11f7119
Binary files /dev/null and b/src/rustdoc/rustdoc differ
index a3984503fae5e02d8176ad0a60e959d525cd76f1..cda361c1be970ae4fcef426a485fc58ef223cef2 100644 (file)
@@ -2,7 +2,7 @@ mod kitties {
 
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 50a5bf1e6240c67e301662df84ec9e647c94b9d6..0bb398839d165c4ef0a1a74c93a196dbbf519785 100644 (file)
@@ -2,7 +2,7 @@ mod kitties {
 
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index a09a5e66a96f9d006f7eb77359734abebc23491d..a30233c8135b8e565a80f038fe3374e4451366ce 100644 (file)
@@ -2,7 +2,7 @@ mod kitties {
 
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 838157ac010a7d9e2992ab17462450aaa3273a3d..4bebf081e2305db08bae7805431915e48706dab6 100644 (file)
@@ -2,7 +2,7 @@ mod kitties {
 
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
     fn meow() {
       #error("Meow");
       meows += 1u;
index a2995bf298667643e7e04b877bc8e3812e5cb77f..6dc4d76cf5248a15e1648d6b68d82eb6628a8dd7 100644 (file)
@@ -2,7 +2,7 @@ mod kitties {
 
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
     fn nap() { uint::range(1u, 10000u) {|_i|}}
   }
 
index 37e5776c2b15295af08014d94295dbbb31cfff82..9ce1561d4d0fb2645f026bd17f9c79f3f57b2923 100644 (file)
@@ -13,7 +13,7 @@
 
 fn LINE_LENGTH() -> uint { ret 60u; }
 
-type myrandom = @{mutable last: u32};
+type myrandom = @{mut last: u32};
 
 fn myrandom_next(r: myrandom, mx: u32) -> u32 {
     r.last = (r.last * 3877u32 + 29573u32) % 139968u32;
@@ -44,7 +44,7 @@ fn bisect(v: [aminoacids], lo: uint, hi: uint, target: u32) -> char {
 
 fn make_random_fasta(id: str, desc: str, genelist: [aminoacids], n: int) {
     log(debug, ">" + id + " " + desc);
-    let rng = @{mutable last: std::rand::rng().next()};
+    let rng = @{mut last: std::rand::rng().next()};
     let mut op: str = "";
     uint::range(0u, n as uint) {|_i|
         str::push_char(op, select_random(myrandom_next(rng, 100u32),
index cc40dfa0b4fe46b129f75293dbd87024e2c977dc..bf493d579e10c13d590df0ef29e29d0928834d3b 100644 (file)
@@ -136,61 +136,61 @@ mod Body {
     const DAYS_PER_YEAR: float = 365.24;
 
     type props =
-        {mutable x: float,
-         mutable y: float,
-         mutable z: float,
-         mutable vx: float,
-         mutable vy: float,
-         mutable vz: float,
+        {mut x: float,
+         mut y: float,
+         mut z: float,
+         mut vx: float,
+         mut vy: float,
+         mut vz: float,
          mass: float};
 
     fn jupiter() -> Body::props {
-        ret {mutable x: 4.84143144246472090e+00,
-             mutable y: -1.16032004402742839e+00,
-             mutable z: -1.03622044471123109e-01,
-             mutable vx: 1.66007664274403694e-03 * DAYS_PER_YEAR,
-             mutable vy: 7.69901118419740425e-03 * DAYS_PER_YEAR,
-             mutable vz: -6.90460016972063023e-05 * DAYS_PER_YEAR,
+        ret {mut x: 4.84143144246472090e+00,
+             mut y: -1.16032004402742839e+00,
+             mut z: -1.03622044471123109e-01,
+             mut vx: 1.66007664274403694e-03 * DAYS_PER_YEAR,
+             mut vy: 7.69901118419740425e-03 * DAYS_PER_YEAR,
+             mut vz: -6.90460016972063023e-05 * DAYS_PER_YEAR,
              mass: 9.54791938424326609e-04 * SOLAR_MASS};
     }
 
     fn saturn() -> Body::props {
-        ret {mutable x: 8.34336671824457987e+00,
-             mutable y: 4.12479856412430479e+00,
-             mutable z: -4.03523417114321381e-01,
-             mutable vx: -2.76742510726862411e-03 * DAYS_PER_YEAR,
-             mutable vy: 4.99852801234917238e-03 * DAYS_PER_YEAR,
-             mutable vz: 2.30417297573763929e-05 * DAYS_PER_YEAR,
+        ret {mut x: 8.34336671824457987e+00,
+             mut y: 4.12479856412430479e+00,
+             mut z: -4.03523417114321381e-01,
+             mut vx: -2.76742510726862411e-03 * DAYS_PER_YEAR,
+             mut vy: 4.99852801234917238e-03 * DAYS_PER_YEAR,
+             mut vz: 2.30417297573763929e-05 * DAYS_PER_YEAR,
              mass: 2.85885980666130812e-04 * SOLAR_MASS};
     }
 
     fn uranus() -> Body::props {
-        ret {mutable x: 1.28943695621391310e+01,
-             mutable y: -1.51111514016986312e+01,
-             mutable z: -2.23307578892655734e-01,
-             mutable vx: 2.96460137564761618e-03 * DAYS_PER_YEAR,
-             mutable vy: 2.37847173959480950e-03 * DAYS_PER_YEAR,
-             mutable vz: -2.96589568540237556e-05 * DAYS_PER_YEAR,
+        ret {mut x: 1.28943695621391310e+01,
+             mut y: -1.51111514016986312e+01,
+             mut z: -2.23307578892655734e-01,
+             mut vx: 2.96460137564761618e-03 * DAYS_PER_YEAR,
+             mut vy: 2.37847173959480950e-03 * DAYS_PER_YEAR,
+             mut vz: -2.96589568540237556e-05 * DAYS_PER_YEAR,
              mass: 4.36624404335156298e-05 * SOLAR_MASS};
     }
 
     fn neptune() -> Body::props {
-        ret {mutable x: 1.53796971148509165e+01,
-             mutable y: -2.59193146099879641e+01,
-             mutable z: 1.79258772950371181e-01,
-             mutable vx: 2.68067772490389322e-03 * DAYS_PER_YEAR,
-             mutable vy: 1.62824170038242295e-03 * DAYS_PER_YEAR,
-             mutable vz: -9.51592254519715870e-05 * DAYS_PER_YEAR,
+        ret {mut x: 1.53796971148509165e+01,
+             mut y: -2.59193146099879641e+01,
+             mut z: 1.79258772950371181e-01,
+             mut vx: 2.68067772490389322e-03 * DAYS_PER_YEAR,
+             mut vy: 1.62824170038242295e-03 * DAYS_PER_YEAR,
+             mut vz: -9.51592254519715870e-05 * DAYS_PER_YEAR,
              mass: 5.15138902046611451e-05 * SOLAR_MASS};
     }
 
     fn sun() -> Body::props {
-        ret {mutable x: 0.0,
-             mutable y: 0.0,
-             mutable z: 0.0,
-             mutable vx: 0.0,
-             mutable vy: 0.0,
-             mutable vz: 0.0,
+        ret {mut x: 0.0,
+             mut y: 0.0,
+             mut z: 0.0,
+             mut vx: 0.0,
+             mut vy: 0.0,
+             mut vz: 0.0,
              mass: SOLAR_MASS};
     }
 
index d1bd69fee0704adab717fb5fbe383d85dab69d22..b9a0b80ebf951dd95ebfa206938f818ec2af4a64 100644 (file)
@@ -6,7 +6,7 @@ fn eval_A(i: uint, j: uint) -> float {
     1.0/(((i+j)*(i+j+1u)/2u+i+1u) as float)
 }
 
-fn eval_A_times_u(u: [const float], Au: [mutable float]) {
+fn eval_A_times_u(u: [const float], Au: [mut float]) {
     let N = vec::len(u);
     let mut i = 0u;
     while i < N {
@@ -20,7 +20,7 @@ fn eval_A_times_u(u: [const float], Au: [mutable float]) {
     }
 }
 
-fn eval_At_times_u(u: [const float], Au: [mutable float]) {
+fn eval_At_times_u(u: [const float], Au: [mut float]) {
     let N = vec::len(u);
     let mut i = 0u;
     while i < N {
@@ -34,7 +34,7 @@ fn eval_At_times_u(u: [const float], Au: [mutable float]) {
     }
 }
 
-fn eval_AtA_times_u(u: [const float], AtAu: [mutable float]) {
+fn eval_AtA_times_u(u: [const float], AtAu: [mut float]) {
     let v = vec::to_mut(vec::from_elem(vec::len(u), 0.0));
     eval_A_times_u(u, v);
     eval_At_times_u(v, AtAu);
index cf6951b23a6957b9a954ed275645b40e827d9664..974c813675100905cf853b10537e93c10477d1da 100644 (file)
@@ -22,7 +22,7 @@
 export grid_t, read_grid, solve_grid, write_grid;
 
 // internal type of sudoku grids
-type grid = [[mutable u8]];
+type grid = [[mut u8]];
 
 // exported type of sudoku grids
 enum grid_t { grid_ctor(grid), }
index 60cc0c03d4d03f31f6f0e2311e49904d338714db..20ffd613240ec366da606d5d6c45796fad4b2fe1 100644 (file)
@@ -103,10 +103,10 @@ fn reduce_task(key: str, out: chan<chan<reduce_proto>>) {
 
         send(out, chan(p));
 
-        let state = @{mutable ref_count: 0, mutable is_done: false};
+        let state = @{mut ref_count: 0, mut is_done: false};
 
-        fn get(p: port<reduce_proto>, state: @{mutable ref_count: int,
-                                               mutable is_done: bool})
+        fn get(p: port<reduce_proto>, state: @{mut ref_count: int,
+                                               mut is_done: bool})
             -> option<int> {
             while !state.is_done || state.ref_count > 0 {
                 alt recv(p) {
index 8a213b0849722a7e03bb4779ad6e4d1b141dfca2..aea25979d9b2b91de042f2c4a065b24d42d59876 100644 (file)
@@ -1,7 +1,7 @@
 // error-pattern:assigning to immutable field
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 1715acc585949cbbff7d9b39fc6dbd68588c83e4..db38c4ad28962c33714f5d639f48d22d8a551d6f 100644 (file)
@@ -1,10 +1,10 @@
 // error-pattern: mismatched types
 
 fn main() {
-    let v = @mutable [0];
+    let v = @mut [0];
 
-    fn f(&&v: @mutable [const int]) {
-        *v = [mutable 3]
+    fn f(&&v: @mut [const int]) {
+        *v = [mut 3]
     }
 
     f(v);
index 072a1f04c8ba462a6de044c139500d2bc09d1d92..7de97e59173ddf9b7fdb0e74dc0a1eb03110379b 100644 (file)
@@ -1,9 +1,9 @@
 // error-pattern: mismatched types
 
 fn main() {
-    let v = [mutable @mutable ~mutable [0]];
+    let v = [mut @mut ~mut [0]];
 
-    fn f(&&v: [mutable @mutable ~mutable [const int]]) {
+    fn f(&&v: [mut @mut ~mut [const int]]) {
     }
 
     f(v);
index f735af5ba73225052ba2bb8dde0706d2d978fd0c..852b474eebb5dfe64373499ba88372ba1be6dd87 100644 (file)
@@ -4,11 +4,11 @@
 
 fn main() {
     let a = [0];
-    let v: *mutable [int] = ptr::mut_addr_of(a);
+    let v: *mut [int] = ptr::mut_addr_of(a);
 
-    fn f(&&v: *mutable [const int]) {
+    fn f(&&v: *mut [const int]) {
         unsafe {
-            *v = [mutable 3]
+            *v = [mut 3]
         }
     }
 
index 3bd079ba6ff03c28a4a6305d44f3902bf435738b..78143f7fbc6721724e419de7aaef7c43b15270f1 100644 (file)
@@ -1,10 +1,10 @@
 // error-pattern: mismatched types
 
 fn main() {
-    let v = {mutable g: [0]};
+    let v = {mut g: [0]};
 
-    fn f(&&v: {mutable g: [const int]}) {
-        v.g = [mutable 3]
+    fn f(&&v: {mut g: [const int]}) {
+        v.g = [mut 3]
     }
 
     f(v);
index 54ffccecaf06ce0ce841f1e6fd07bb909de73dbe..cd8d2ca6f106ea26df4f1c6bb0701ffb987346d3 100644 (file)
@@ -1,10 +1,10 @@
 // error-pattern: mismatched types
 
 fn main() {
-    let v = ~mutable [0];
+    let v = ~mut [0];
 
-    fn f(&&v: ~mutable [const int]) {
-        *v = [mutable 3]
+    fn f(&&v: ~mut [const int]) {
+        *v = [mut 3]
     }
 
     f(v);
index 895322309d0f3a4e4df0b17206e9089a9d8800df..3519127ab1bc07e9ac4573f794cff6a2756d3bb7 100644 (file)
@@ -2,10 +2,10 @@ fn main() {
     // Note: explicit type annot is required here
     // because otherwise the inference gets smart
     // and assigns a type of [mut [const int]].
-    let v: [mut [int]] = [mutable [0]];
+    let v: [mut [int]] = [mut [0]];
 
-    fn f(&&v: [mutable [const int]]) {
-        v[0] = [mutable 3]
+    fn f(&&v: [mut [const int]]) {
+        v[0] = [mut 3]
     }
 
     f(v); //! ERROR (values differ in mutability)
index 3a0725f6643dcef583683ebd5461ce7ff2ba5d03..09c3565e8b20c8bb145164976d334fb2776a9c66 100644 (file)
@@ -2,9 +2,9 @@ fn main() {
     // Note: explicit type annot is required here
     // because otherwise the inference gets smart
     // and assigns a type of [mut [const int]].
-    let v: [mut [mut int]] = [mutable [mutable 0]];
+    let v: [mut [mut int]] = [mut [mut 0]];
 
-    fn f(&&v: [mutable [const int]]) {
+    fn f(&&v: [mut [const int]]) {
         v[0] = [3]
     }
 
index 786535dd4bcb2bfd49d5cf0951273e6b7b5d9566..97b6ccabdfd219d2e827fb2e22d1488574617ce5 100644 (file)
@@ -2,10 +2,10 @@ fn main() {
     // Note: explicit type annot is required here
     // because otherwise the inference gets smart
     // and assigns a type of [mut [const int]].
-    let v: [mut[mut[int]]] = [mutable [mutable [0]]];
+    let v: [mut[mut[int]]] = [mut [mut [0]]];
 
-    fn f(&&v: [mutable [mutable [const int]]]) {
-        v[0][1] = [mutable 3]
+    fn f(&&v: [mut [mut [const int]]]) {
+        v[0][1] = [mut 3]
     }
 
     f(v); //! ERROR (values differ in mutability)
index 9244b4b73b3f34bbdf54c92312496ea949f506ad..1a07b3f1de0e09a058ade143289db424ab92efc3 100644 (file)
@@ -1,11 +1,11 @@
 // error-pattern: copying a noncopyable value
 
-resource r(i: @mutable int) {
+resource r(i: @mut int) {
     *i = *i + 1;
 }
 
 fn main() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         // Can't do this copy
         let x = ~~~{y: r(i)};
index a3d77507cb555bbca207d095c0be92c1936c68c9..c0fb997d14c0bb89afbfbe7990ca74d75ba8d45d 100644 (file)
@@ -1,7 +1,7 @@
 // error-pattern:no public field or method with that name
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 7dc1f44d71bbf9b8fd33cd03b279093515ea91e3..7e45660deb7164bf89f343a4a212d4d1adf97745 100644 (file)
@@ -1,7 +1,7 @@
 // error-pattern:attempted access of field nap on type
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
     fn nap() { uint::range(1u, 10000u) {|_i|}}
   }
 
index bb5779bc1dba0769fbf079cd42403d37a0b4a9df..04c88a3d1030ec5543e1353fca04010631bac1c6 100644 (file)
@@ -1,4 +1,4 @@
 //error-pattern:mismatched types
 fn main() {
-    let i: ~int = ~mutable 0;
+    let i: ~int = ~mut 0;
 }
\ No newline at end of file
index fdc9072fd930e7c159a7ad10c2130498927a90d8..045a22fa8e0340e4e8dafa88d300d8143ee8ca49 100644 (file)
@@ -1,6 +1,6 @@
 // error-pattern: copying a noncopyable value
 
-resource r(i: @mutable int) {
+resource r(i: @mut int) {
     *i = *i + 1;
 }
 
@@ -9,8 +9,8 @@ fn f<T>(+i: [T], +j: [T]) {
 }
 
 fn main() {
-    let i1 = @mutable 0;
-    let i2 = @mutable 1;
+    let i1 = @mut 0;
+    let i2 = @mut 1;
     let r1 <- [~r(i1)];
     let r2 <- [~r(i2)];
     f(r1, r2);
index ec1e5c01ffb7b4c506fde3abe6067ae72fabefd2..ac20aeec931fbb3b1301baea4e8f6984c3768330 100644 (file)
@@ -1,8 +1,8 @@
 // error-pattern:invalidate reference x
 
-fn whoknows(x: @mutable {mutable x: int}) { x.x = 10; }
+fn whoknows(x: @mut {mut x: int}) { x.x = 10; }
 
 fn main() {
-    let box = @mutable {mutable x: 1};
+    let box = @mut {mut x: 1};
     alt *box { x { whoknows(box); log(error, x); } }
 }
index 905a6a922f16a0e6a1cd1d5eae9c81147330ca58..0b13c5b5305a15621e9cacd11e41a129a154a62e 100644 (file)
@@ -1,10 +1,10 @@
 // error-pattern:may alias with argument
 
-fn foo(x: {mutable x: int}, f: fn@()) { log(debug, x); }
+fn foo(x: {mut x: int}, f: fn@()) { log(debug, x); }
 
-fn whoknows(x: @mutable {mutable x: int}) { *x = {mutable x: 10}; }
+fn whoknows(x: @mut {mut x: int}) { *x = {mut x: 10}; }
 
 fn main() {
-    let box = @mutable {mutable x: 1};
+    let box = @mut {mut x: 1};
     foo(*box, bind whoknows(box));
 }
index b0291ea4e83bf57713c768b86953f5ff5191bdcd..92aa4ac00a4cf20ac901e057a03933664ca15ac2 100644 (file)
@@ -1,8 +1,8 @@
 // error-pattern:invalidate reference i
 
-enum foo { left({mutable x: int}), right(bool) }
+enum foo { left({mut x: int}), right(bool) }
 
 fn main() {
-    let x = left({mutable x: 10});
+    let x = left({mut x: 10});
     alt x { left(i) { x = right(false); log(debug, i); } _ { } }
 }
index 05bad8ee833da30d0095545cfd341f9ee09871e5..a4e54d33fe724475779e3829d27fa06dddfd99e4 100644 (file)
@@ -1,6 +1,6 @@
 // error-pattern:invalidate reference x
 
 fn main() {
-    let v: [mutable {mutable x: int}] = [mutable {mutable x: 1}];
-    for x in v { v[0] = {mutable x: 2}; log(debug, x); }
+    let v: [mut {mut x: int}] = [mut {mut x: 1}];
+    for x in v { v[0] = {mut x: 2}; log(debug, x); }
 }
index 3ab7fe974a534cb2f704ffba8d60930cf74fbf51..1767eb3983cdfb34dcdf216f68a03ff7fe0fac74 100644 (file)
@@ -1,8 +1,8 @@
-// error-pattern:mutable reference to a variable that roots another reference
+// error-pattern:mut reference to a variable that roots another reference
 
-fn f(a: {mutable x: int}, &b: {mutable x: int}) -> int {
+fn f(a: {mut x: int}, &b: {mut x: int}) -> int {
     b.x += 1;
     ret a.x + b.x;
 }
 
-fn main() { let i = {mutable x: 4}; log(debug, f(i, i)); }
+fn main() { let i = {mut x: 4}; log(debug, f(i, i)); }
index 647525059523476f2d7e0d396e576ea20795a295..4157515b41c0ce7f2c2a591b691e5366a295542f 100644 (file)
@@ -7,7 +7,7 @@
 fn test2() -> int { let val = @0; { } *val }
 
 fn test3() {
-    let regs = @{mutable eax: 0};
+    let regs = @{mut eax: 0};
     alt check true { true { } }
     (*regs).eax = 1;
 }
@@ -36,10 +36,10 @@ fn test8() -> int {
     }
 }
 
-fn test9() { let regs = @mutable 0; alt check true { true { } } *regs += 1; }
+fn test9() { let regs = @mut 0; alt check true { true { } } *regs += 1; }
 
 fn test10() -> int {
-    let regs = @mutable [0];
+    let regs = @mut [0];
     alt check true { true { } }
     (*regs)[0]
 }
index 28e93d0edbda8063488acc34f7a9ec7f49fbf059..34d08570be43b51f2fa6ae4e533fcd657da57977 100644 (file)
@@ -6,7 +6,7 @@
 import uint;
 
 fn main() {
-    let count = @mutable 0u;
+    let count = @mut 0u;
     fn hash(&&s: [@str]) -> uint {
         if (vec::len(s) > 0u && str::eq(*s[0], "boom")) { fail; }
         ret 10u;
index f3fe07fcc2b9a9fd2e1eedc20cb6af38faf9f08a..641aceb9b16b53cf18bcdf4ee14ac8196faf412b 100644 (file)
@@ -5,11 +5,11 @@
 enum rec<A> = _rec<A>;
 type _rec<A> = {
     val: A,
-    mutable rec: option<@rec<A>>
+    mut rec: option<@rec<A>>
 };
 
 fn make_cycle<A:copy>(a: A) {
-    let g: @rec<A> = @rec({val: a, mutable rec: none});
+    let g: @rec<A> = @rec({val: a, mut rec: none});
     g.rec = some(g);
 }
 
index 73de058949a7b2194269cc86efd5cda787a15772..1bad14183828aef60d60f25d3770ab890d276cbd 100644 (file)
@@ -1,7 +1,7 @@
 enum option<T> { some(T), none, }
 
-type r<T> = {mutable v: [option<T>]};
+type r<T> = {mut v: [option<T>]};
 
 fn f<T>() -> [T] { ret []; }
 
-fn main() { let r: r<int> = {mutable v: []}; r.v = f(); }
+fn main() { let r: r<int> = {mut v: []}; r.v = f(); }
index ce5233ad1dfba420f55f7fb7243970eeb2a4d504..bffa76efa302a121f49e5c26064f11c9c96a0c68 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let x = ~{mutable a: ~10, b: ~20};
+    let x = ~{mut a: ~10, b: ~20};
     alt x {
       ~{a, b} { assert *a == 10; (*x).a = ~30; assert *a == 10; }
     }
index 7bb148b1b9118ee7f9a3fb0c8fdae9efd193528b..43de34e87a83e98622e06fbf9cc46b03ad70466b 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let x = @{mutable a: @10, b: @20};
+    let x = @{mut a: @10, b: @20};
     alt x {
       @{a, b} { assert *a == 10; (*x).a = @30; assert *a == 10; }
     }
index 3af1d92a8ea86ff84a685e604f568840f3575947..2f17efd32793520c63ecf968ba2fd38f6f113b7f 100644 (file)
@@ -1,4 +1,4 @@
-fn f1(a: {mutable x: int}, &b: int, -c: int) -> int {
+fn f1(a: {mut x: int}, &b: int, -c: int) -> int {
     let r = a.x + b + c;
     a.x = 0;
     b = 10;
@@ -9,7 +9,7 @@ fn f1(a: {mutable x: int}, &b: int, -c: int) -> int {
 fn f2(a: int, f: fn(int)) -> int { f(1); ret a; }
 
 fn main() {
-    let mut a = {mutable x: 1}, b = 2, c = 3;
+    let mut a = {mut x: 1}, b = 2, c = 3;
     assert (f1(a, b, c) == 6);
     assert (a.x == 0);
     assert (b == 10);
index 79daecfe35e97985c0f9cf07c86115d83bff03e9..f1769b0fb5039c15c3e8bd62fec952f23b46a01d 100644 (file)
@@ -1,6 +1,6 @@
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 62084958d5a17e6d0d384f671c95c647757cb41f..dff5a035d987d6934c0cee600166b731dc5d5207 100644 (file)
@@ -1,6 +1,6 @@
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 3b4df149fa5839fcb9e4f202e8a1d5bb9ad9eae1..bb0384f902e9cbd20f02717e34fb8c521e399f54 100644 (file)
@@ -1,6 +1,6 @@
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index c2d5735969c1c6e08e9e420d9e69be96cbda3d02..0117519089a63c1b4bc731d7445d1fdc33447534 100644 (file)
@@ -1,6 +1,6 @@
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
     fn meow() {
       #error("Meow");
       meows += 1u;
index dd00fcbbbefcd5369f36d3a4fdaa817f52130146..2f6716253926bbf659ba4665c7a1edf412428d1a 100644 (file)
@@ -1,10 +1,10 @@
 enum taggy {
-    cons(@mutable taggy),
+    cons(@mut taggy),
     nil,
 }
 
 fn f() {
-    let box = @mutable nil;
+    let box = @mut nil;
     *box = cons(box);
 }
 
index 33609d17c09d85902cc12dd7873173825c04fb03..406e73f545c9df5ab2db95ac6052347a1cd35906 100644 (file)
@@ -1,10 +1,10 @@
-type foo = { mutable z : fn@() };
+type foo = { mut z : fn@() };
 
 fn nop() { }
 fn nop_foo(_x : @foo) { }
 
 fn main() {
-    let w = @{ mutable z: bind nop() };
+    let w = @{ mut z: bind nop() };
     let x = bind nop_foo(w);
     w.z = x;
 }
\ No newline at end of file
index d7a16f63a6d76cd8a102e0f7b0de6eaf506abc24..833fb3aafc53f424e41c67bee5a87d76cd19bb68 100644 (file)
@@ -1,10 +1,10 @@
-type foo = { mutable z : fn@() };
+type foo = { mut z : fn@() };
 
 fn nop() { }
 fn nop_foo(_y: [int], _x : @foo) { }
 
 fn main() {
-    let w = @{ mutable z: bind nop() };
+    let w = @{ mut z: bind nop() };
     let x = bind nop_foo([], w);
     w.z = x;
 }
\ No newline at end of file
index af01d9a35e7e07adcf6ee01c4bf7d9e4a7df38d0..e64bdd16bf43293137d61716449e7dd0bb57d531 100644 (file)
@@ -1,4 +1,4 @@
-type foo = { mutable z : fn@() };
+type foo = { mut z : fn@() };
 
 fn nop() { }
 fn nop_foo(_y: @int, _x : @foo) { }
@@ -6,7 +6,7 @@ fn nop_foo(_y: @int, _x : @foo) { }
 fn o() -> @int { @10 }
 
 fn main() {
-    let w = @{ mutable z: bind nop() };
+    let w = @{ mut z: bind nop() };
     let x = bind nop_foo(o(), w);
     w.z = x;
 }
\ No newline at end of file
index 2784b16b99a2e1230271fadede8df8294a2dac99..07c2e91d539ea60de7500323cedfe152c88ee059 100644 (file)
@@ -1,3 +1,3 @@
 
 
-fn main() { let x = @mutable 5; *x = 1000; log(debug, *x); }
+fn main() { let x = @mut 5; *x = 1000; log(debug, *x); }
index 6dfd54461600e37f555962e13bffb5ef175fe2fd..eaec2ab31d546e4228a9837082089e7d941dbf76 100644 (file)
@@ -1,3 +1,3 @@
 
 
-fn main() { let v: [mutable int] = [mutable]; }
+fn main() { let v: [mut int] = [mut]; }
index f0b214695287724bb260b00f538fa169e11c9811..279e916b75ad2d3f93f1854e6a329a99ae10d828 100644 (file)
@@ -1,9 +1,9 @@
-fn f(arg: {mutable a: int}) {
+fn f(arg: {mut a: int}) {
     arg.a = 100;
 }
 
 fn main() {
-    let x = {mutable a: 10};
+    let x = {mut a: 10};
     f(x);
     assert x.a == 100;
     x.a = 20;
index 228f7dff061395da9d1f209acce9946b2cc61e4d..6890bb12789d6ccf8cfeef802ff8a5665fb81c91 100644 (file)
@@ -2,12 +2,12 @@
 
 
 // -*- rust -*-
-type point = {x: int, y: int, mutable z: int};
+type point = {x: int, y: int, mut z: int};
 
 fn f(p: @point) { assert (p.z == 12); p.z = 13; assert (p.z == 13); }
 
 fn main() {
-    let a: point = {x: 10, y: 11, mutable z: 12};
+    let a: point = {x: 10, y: 11, mut z: 12};
     let b: @point = @a;
     assert (b.z == 12);
     f(b);
index a91b572e70342f65e8b58ff07d21ae9f909436fe..572556370a7a26bd52ef4f6484f0cbc6d467ad45 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let x = [@{mutable a: @10, b: @20}];
+    let x = [@{mut a: @10, b: @20}];
     for @{a, b} in x {
         assert *a == 10;
         (*x[0]).a = @30;
index 6afd21559dd1ab888628ba794420d1504ac4016c..3cc0a5a82f1a3f9feb8ab703f00486aee5484e1e 100644 (file)
@@ -5,7 +5,7 @@
 fn two(it: fn(int)) { it(0); it(1); }
 
 fn main() {
-    let a: [mutable int] = [mutable -1, -1, -1, -1];
+    let a: [mut int] = [mut -1, -1, -1, -1];
     let mut p: int = 0;
     two {|i|
         two {|j| a[p] = 10 * i + j; p += 1; };
index 94dbc3fcdb044e772a62510ad3ebd7b20521e8e4..b771eca4be80e3d23f9e847d237f72a18abb256d 100644 (file)
@@ -2,8 +2,8 @@
 
 enum Tree = TreeR;
 type TreeR = @{
-    mutable left: option<Tree>,
-    mutable right: option<Tree>,
+    mut left: option<Tree>,
+    mut right: option<Tree>,
     val: to_str
 };
 
@@ -36,11 +36,11 @@ fn to_str() -> str {
 fn foo<T: to_str>(x: T) -> str { x.to_str() }
 
 fn main() {
-    let t1 = Tree(@{mutable left: none,
-                    mutable right: none,
+    let t1 = Tree(@{mut left: none,
+                    mut right: none,
                     val: 1 as to_str });
-    let t2 = Tree(@{mutable left: some(t1),
-                    mutable right: some(t1),
+    let t2 = Tree(@{mut left: some(t1),
+                    mut right: some(t1),
                     val: 2 as to_str });
     let expected = "[2, some([1, none, none]), some([1, none, none])]";
     assert t2.to_str() == expected;
index f79cef2a0e730c7bee2145d12436ebce535089a0..c7609973a04aa7ab4be6bdd9b22a49e5ccee7e08 100644 (file)
@@ -1,12 +1,12 @@
 // Resources can't be copied, but storing into data structures counts
 // as a move unless the stored thing is used afterwards.
 
-resource r(i: @mutable int) {
+resource r(i: @mut int) {
     *i = *i + 1;
 }
 
 fn test_box() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let a <- @r(i);
     }
@@ -14,7 +14,7 @@ fn test_box() {
 }
 
 fn test_rec() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let a <- {x: r(i)};
     }
@@ -26,7 +26,7 @@ enum t {
         t0(r),
     }
 
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let a <- t0(r(i));
     }
@@ -34,7 +34,7 @@ enum t {
 }
 
 fn test_tup() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let a <- (r(i), 0);
     }
@@ -42,7 +42,7 @@ fn test_tup() {
 }
 
 fn test_unique() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let a <- ~r(i);
     }
@@ -50,7 +50,7 @@ fn test_unique() {
 }
 
 fn test_box_rec() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let a <- @{
             x: r(i)
index 77482843b072ff8670ae82fefba8b640b16a622b..3de02c5679d4ad8ed6819de83e23a6172a72b03d 100644 (file)
@@ -1,9 +1,9 @@
-resource r(b: @mutable int) {
+resource r(b: @mut int) {
     *b += 1;
 }
 
 fn main() {
-    let b = @mutable 0;
+    let b = @mut 0;
     {
         let p = some(r(b));
     }
index ddbc648ae0af0aea5ca075502e8beacc9e6acb0b..41702fbee97ed386c4ee03e484403fdfa693b4ca 100644 (file)
@@ -4,10 +4,10 @@ enum maybe_pointy {
 }
 
 type pointy = {
-    mutable x : maybe_pointy
+    mut x : maybe_pointy
 };
 
 fn main() {
-    let m = @{ mutable x : no_pointy };
+    let m = @{ mut x : no_pointy };
     m.x = yes_pointy(m);
 }
index d526c00a99814ad456147dbdfde250ba87f40c34..36b93774c86f78387c5ba7ee78ecb3a819baacfa 100644 (file)
@@ -1,7 +1,7 @@
 // This should typecheck even though the type of e is not fully
 // resolved when we finish typechecking the fn@.
 fn main() {
-    let e = @{mutable refs: [], n: 0};
+    let e = @{mut refs: [], n: 0};
     let f = fn@ () { log(error, e.n); };
     e.refs += [1];
 }
index 0a7f0b28340cd93b273ea6b4fc6d9582a63b3176..3e202e84b8120d1ca629f2220ec8cb83c5b1cf3b 100644 (file)
@@ -5,11 +5,11 @@ enum option<T> {
     some(T),
 }
 
-type smallintmap<T> = @{mutable v: [mutable option<T>]};
+type smallintmap<T> = @{mut v: [mut option<T>]};
 
 fn mk<T>() -> smallintmap<T> {
-    let v: [mutable option<T>] = [mutable];
-    ret @{mutable v: v};
+    let v: [mut option<T>] = [mut];
+    ret @{mut v: v};
 }
 
 fn f<T,U>() {
index 788c24aa24d27b0221b9d44cb119c27ae23c9eea..c66de1b33676c8b1da3e778b49bb6abce6b3b4ed 100644 (file)
@@ -11,6 +11,6 @@ fn len(v: [const int]) -> uint {
 fn main() {
     let v0 = [1, 2, 3, 4, 5];
     log(debug, len(v0));
-    let v1 = [mutable 1, 2, 3, 4, 5];
+    let v1 = [mut 1, 2, 3, 4, 5];
     log(debug, len(v1));
 }
index 455368c47716c598d1c87ffe80b44f1e036b2e60..3c7a5007f37c770de99da19645220a4838ec7ac2 100644 (file)
@@ -2,14 +2,14 @@
 // -*- rust -*-
 use std;
 
-type cell = {mutable c: @list};
+type cell = {mut c: @list};
 
 enum list { link(@cell), nil, }
 
 fn main() {
-    let first: @cell = @{mutable c: @nil()};
-    let second: @cell = @{mutable c: @link(first)};
+    let first: @cell = @{mut c: @nil()};
+    let second: @cell = @{mut c: @link(first)};
     first._0 = @link(second);
     sys.rustrt.gc();
-    let third: @cell = @{mutable c: @nil()};
+    let third: @cell = @{mut c: @nil()};
 }
\ No newline at end of file
index b36ec502896a3239910371b0eea9556b37b315cc..31cfab18ddcb2fe354f11f783c9e965d0e606e09 100644 (file)
@@ -4,7 +4,7 @@ fn main() {
     let v = [[0]];
 
     // This is ok because the outer vec is covariant with respect
-    // to the inner vec. If the outer vec was mutable then we
+    // to the inner vec. If the outer vec was mut then we
     // couldn't do this.
     fn f(&&v: [[const int]]) {
     }
index 82b0a029ba96d4a9f9df6905b903db85374fd581..7815554cdabe24489eec40a87bacd6c1ad2dec05 100644 (file)
@@ -4,7 +4,7 @@ fn main() {
     let v = [[0]];
 
     // This is ok because the outer vec is covariant with respect
-    // to the inner vec. If the outer vec was mutable then we
+    // to the inner vec. If the outer vec was mut then we
     // couldn't do this.
     fn f(&&v: [const [const int]]) {
     }
index 625bcb17f97e8e02be321c096e576d2fa4ae56e4..2b1433d8a65aa7d83ce6556d9913a6fd8f58bd34 100644 (file)
@@ -1,6 +1,6 @@
 
 fn main() {
     // This just tests whether the vec leaks its members.
-    let pvec: [mutable @{a: int, b: int}] =
-        [mutable @{a: 1, b: 2}, @{a: 3, b: 4}, @{a: 5, b: 6}];
+    let pvec: [mut @{a: int, b: int}] =
+        [mut @{a: 1, b: 2}, @{a: 3, b: 4}, @{a: 5, b: 6}];
 }
index 79eb1d40e4d1acea6bf765a624eec4f982aa3a6b..d58cb896a602c77b165df958d7691654e757c71c 100644 (file)
@@ -3,10 +3,10 @@ fn main() {
         x@{a, b: @20} { assert x.a == 10; assert a == 10; }
         {b, _} { fail; }
     }
-    let x@{b, _} = {a: 10, b: {mutable c: 20}};
+    let x@{b, _} = {a: 10, b: {mut c: 20}};
     x.b.c = 30;
     assert b.c == 20;
-    let y@{d, _} = {a: 10, d: {mutable c: 20}};
+    let y@{d, _} = {a: 10, d: {mut c: 20}};
     y.d.c = 30;
     assert d.c == 20;
 }
index 6d11ce2c3dad2280a659f40b135b99b4016d864d..f2f7c795252b2cd2f216b9738caedc0050101d52 100644 (file)
@@ -1,6 +1,6 @@
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
   }
 
   let how_hungry : int;
index 6e95d3d314f9cac03365879d777321cdfb90b3d8..2cc75e1ec3c82aaebeecfb1644081692832e4add 100644 (file)
@@ -1,6 +1,6 @@
 class cat {
   priv {
-    let mutable meows : uint;
+    let mut meows : uint;
     fn nap() { uint::range(1u, 10u) {|_i|}}
   }
 
index b1a95b9fff9a0a205d918f75cc2b7b0a68c601b2..de70e2c67d120eab07b5df6b960bb8ab8f9c013c 100644 (file)
@@ -17,10 +17,10 @@ fn new_parse_sess() -> parser::parse_sess {
     let handler = diagnostic::mk_handler(option::none);
     let sess = @{
         cm: cm,
-        mutable next_id: 1,
+        mut next_id: 1,
         span_diagnostic: diagnostic::mk_span_handler(handler, cm),
-        mutable chpos: 0u,
-        mutable byte_pos: 0u
+        mut chpos: 0u,
+        mut byte_pos: 0u
     };
     ret sess;
 }
index 61fcb47725d5f7f27a8974f5b5650cf95b631325..36500898f79ac85bbb05ba3f1d7af8ebfb560f8a 100644 (file)
@@ -1,6 +1,6 @@
 fn main() {
     let x: int = 3;
-    let y: &mutable int = &mutable x;
+    let y: &mut int = &mut x;
     *y = 5;
     log (debug, *y);
 }
index 1261878db2e633f897965cda617741d26a91d4f5..5f8d3a2319d3c7aeb796388a31523b540d919d42 100644 (file)
@@ -1,7 +1,7 @@
-resource r(i: @mutable int) { *i += 1; }
+resource r(i: @mut int) { *i += 1; }
 
 fn main() {
-    let i = @mutable 0;
+    let i = @mut 0;
     // Even though these look like copies, they are guaranteed not to be
     {
         let a = r(i);
index 2df6dddb2a487d29d756ccd9051292e3797d7928..a575d17d2f6017069f2b934214abf4ae568a4832 100644 (file)
@@ -1,9 +1,9 @@
-resource shrinky_pointer(i: @mutable int) { *i -= 1; }
+resource shrinky_pointer(i: @mut int) { *i -= 1; }
 
 fn look_at(pt: shrinky_pointer) -> int { ret **pt; }
 
 fn main() {
-    let my_total = @mutable 10;
+    let my_total = @mut 10;
     { let pt <- shrinky_pointer(my_total); assert (look_at(pt) == 10); }
     assert (*my_total == 9);
 }
index 34f823a543b6108d9cfe6a8ac4abf9a4197a40b7..08e546749dc26f01ad905d51ee7c9b8e4473804a 100644 (file)
@@ -3,8 +3,8 @@
 }
 
 fn main() {
-    let box = @mutable 10;
-    fn dec_box(&&i: @mutable int) { *i -= 1; }
+    let box = @mut 10;
+    fn dec_box(&&i: @mut int) { *i -= 1; }
 
     { let i <- finish({val: box, fin: dec_box}); }
     assert (*box == 9);
index f2dbb04f1b2d66741c0f102c418e83a48233c945..f5a0afe94796879304642cb4ff50d00eab552c11 100644 (file)
@@ -1,7 +1,7 @@
 // Ensures that putting resources inside structual types keeps
 // working.
 
-type closable = @mutable bool;
+type closable = @mut bool;
 
 resource close_res(i: closable) { *i = false; }
 
@@ -10,7 +10,7 @@ enum option<T> { none, some(T), }
 fn sink(res: option<close_res>) { }
 
 fn main() {
-    let c = @mutable true;
+    let c = @mut true;
     sink(none);
     sink(some(close_res(c)));
     assert (!*c);
index f9d1fc1dbd73378deb59eed62394adafb5ed85fe..96e06e65c70a1f5789cf7d08fa4e79065867a5ec 100644 (file)
@@ -8,7 +8,7 @@
 fn mk_counter<A:copy>() -> fn~(A) -> (A,uint) {
     // The only reason that the counter is generic is so that it closes
     // over both a type descriptor and some data.
-    let v = [mutable 0u];
+    let v = [mut 0u];
     ret fn~(a: A) -> (A,uint) {
         let n = v[0];
         v[0] = n + 1u;
index c9a599fb73f76abefda5927f9fe82d38a21e0a82..f94205f4a9f6fb73c762735ec50a9bd7cb1f7d26 100644 (file)
@@ -1,7 +1,7 @@
-fn swap<T>(v: [mutable T], i: int, j: int) { v[i] <-> v[j]; }
+fn swap<T>(v: [mut T], i: int, j: int) { v[i] <-> v[j]; }
 
 fn main() {
-    let a: [mutable int] = [mutable 0, 1, 2, 3, 4, 5, 6];
+    let a: [mut int] = [mut 0, 1, 2, 3, 4, 5, 6];
     swap(a, 2, 4);
     assert (a[2] == 4);
     assert (a[4] == 2);
index f7829aa31dfe930731b03b8acde0f2897735aa0a..f84645c1dbf505bdc6bff23a1b9a1d92367dd8cd 100644 (file)
@@ -8,7 +8,7 @@
 
 fn joinable(f: fn()) -> (task::task, comm::port<bool>) {
     resource notify(data: (comm::chan<bool>,
-                           @mutable bool)) {
+                           @mut bool)) {
         let (c, v) = data;
         #error["notify: task=%d v=%x unwinding=%b b=%b",
                task::get_task(),
@@ -19,7 +19,7 @@ fn joinable(f: fn()) -> (task::task, comm::port<bool>) {
     }
     fn wrapper(pair: (comm::chan<bool>, fn())) {
         let (c, f) = pair;
-        let b = @mutable false;
+        let b = @mut false;
         #error["wrapper: task=%d allocated v=%x",
                task::get_task(),
                ptr::addr_of(*b) as uint];
index 9666018d8146ba77c0c6703ae623b46baf6760f9..b2990d3d1017461b7a885281df47730d7dea0171 100644 (file)
@@ -4,7 +4,7 @@ enum maybe_pointy {
 }
 
 type pointy = {
-    mutable a : maybe_pointy,
+    mut a : maybe_pointy,
     d : fn~() -> uint,
 };
 
@@ -14,7 +14,7 @@ fn make_uniq_closure<A:send>(a: A) -> fn~() -> uint {
 
 fn empty_pointy() -> @pointy {
     ret @{
-        mutable a : none,
+        mut a : none,
         d : make_uniq_closure("hi")
     }
 }
index ad4581e12cd11c2c6b2ce53a94ee3a7c6ea3d252..f238e3e4e9f7a4c65e2ce9852904bac679747c9d 100644 (file)
@@ -4,14 +4,14 @@ enum maybe_pointy {
 }
 
 type pointy = {
-    mutable a : maybe_pointy,
+    mut a : maybe_pointy,
     c : ~int,
     d : fn~()->(),
 };
 
 fn empty_pointy() -> @pointy {
     ret @{
-        mutable a : none,
+        mut a : none,
         c : ~22,
         d : fn~()->(){},
     }
index 2ae6ea8d2893d930df25ded4072a49e88a2a36be..2c152c9805ca53a7a9b0a89a52efa25963015040 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let i = ~mutable 1;
+    let i = ~mut 1;
     // Should be a copy
     let mut j;
     j = i;
index d9808b6f50d31b9d31c950fa60d9adf91ed62bdf..ab8df403a77bf17199fad48700439575ccc32c85 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let i = ~mutable 1;
+    let i = ~mut 1;
     // Should be a copy
     let j = i;
     *i = 2;
index bad975edb565c971736f20151b4e6d253d5e055f..1a9eb581c2428a1b2f9fbdc23db5598a17920bbe 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let a = [~mutable 10];
+    let a = [~mut 10];
     let b = a;
 
     assert *a[0] == 10;
index ef3b818c9f60f3fdfef83084d8f136431fd0e88d..fd991c20503d4cf42671e3f93fc8124895c0b318 100644 (file)
@@ -1,5 +1,5 @@
 fn main() {
-    let i = ~mutable 0;
+    let i = ~mut 0;
     *i = 1;
     assert *i == 1;
 }
\ No newline at end of file
index 92b86ad0d34d9f3c9ebe940c0eaa34b86e6c238b..ff94532f9c5946a25fb2f4c052cb9b31e18a0229 100644 (file)
@@ -1,9 +1,9 @@
-resource r(i: @mutable int) {
+resource r(i: @mut int) {
     *i = *i + 1;
 }
 
 fn main() {
-    let i = @mutable 0;
+    let i = @mut 0;
     {
         let j = ~r(i);
     }
index 4e0c69cdbcc504f3a735d443df6fd0d06b24a4a8..0640bacbfe4246a8d46463526ce2af86a11d15eb 100644 (file)
@@ -8,8 +8,8 @@ fn f(_x: ()) { }
 }
 
 fn what() {
-    fn the(x: @mutable bool) { ret while !*x { *x = true; }; }
-    let i = @mutable false;
+    fn the(x: @mut bool) { ret while !*x { *x = true; }; }
+    let i = @mut false;
     let dont = bind the(i);
     dont();
     assert (*i);
index 816b08db72401ebe2d0a9de0df6de4cbf1482d3d..9dba2e2adfdcbe6a183415e9e7f72303e8a905ad 100644 (file)
@@ -2,12 +2,12 @@
 
 
 // -*- rust -*-
-type point = {x: int, y: int, mutable z: int};
+type point = {x: int, y: int, mut z: int};
 
 fn f(&p: point) { p.z = 13; }
 
 fn main() {
-    let mut x: point = {x: 10, y: 11, mutable z: 12};
+    let mut x: point = {x: 10, y: 11, mut z: 12};
     f(x);
     assert (x.z == 13);
 }