]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Remove the `const` declaration form everywhere
authorPatrick Walton <pcwalton@mimiga.net>
Fri, 22 Mar 2013 21:00:15 +0000 (14:00 -0700)
committerPatrick Walton <pcwalton@mimiga.net>
Sat, 23 Mar 2013 05:24:35 +0000 (22:24 -0700)
157 files changed:
src/libcore/flate.rs
src/libcore/gc.rs
src/libcore/hashmap.rs
src/libcore/libc.rs
src/libcore/managed.rs
src/libcore/num/cmath.rs
src/libcore/num/f32.rs
src/libcore/num/f64.rs
src/libcore/num/float.rs
src/libcore/num/int-template.rs
src/libcore/num/int-template/i16.rs
src/libcore/num/int-template/i32.rs
src/libcore/num/int-template/i64.rs
src/libcore/num/int-template/i8.rs
src/libcore/num/int-template/int.rs
src/libcore/num/strconv.rs
src/libcore/num/uint-template.rs
src/libcore/num/uint-template/u16.rs
src/libcore/num/uint-template/u32.rs
src/libcore/num/uint-template/u64.rs
src/libcore/num/uint-template/u8.rs
src/libcore/num/uint-template/uint.rs
src/libcore/os.rs
src/libcore/pipes.rs
src/libcore/rand.rs
src/libcore/rt/context.rs
src/libcore/rt/sched.rs
src/libcore/rt/thread_local_storage.rs
src/libcore/rt/uv.rs
src/libcore/str.rs
src/libcore/task/mod.rs
src/libcore/trie.rs
src/libcore/unstable/extfmt.rs
src/libcore/unstable/global.rs
src/libcore/unstable/lang.rs
src/libfuzzer/cycles.rs
src/librust/rust.rc
src/librustc/back/abi.rs
src/librustc/driver/session.rs
src/librustc/front/core_inject.rs
src/librustc/front/test.rs
src/librustc/lib/llvm.rs
src/librustc/metadata/common.rs
src/librustc/metadata/encoder.rs
src/librustc/middle/kind.rs
src/librustc/middle/liveness.rs
src/librustc/middle/trans/build.rs
src/librustc/middle/trans/common.rs
src/librustc/middle/trans/consts.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/trans/type_use.rs
src/librustc/middle/ty.rs
src/librustc/middle/typeck/astconv.rs
src/librustc/middle/typeck/infer/resolve.rs
src/librustc/middle/typeck/infer/test.rs
src/librustdoc/demo.rs
src/librustdoc/desc_to_brief_pass.rs
src/librustdoc/extract.rs
src/librustdoc/fold.rs
src/librustdoc/markdown_pass.rs
src/librustdoc/sort_item_type_pass.rs
src/librustdoc/tystr_pass.rs
src/librustpkg/util.rs
src/libstd/arena.rs
src/libstd/bigint.rs
src/libstd/bitv.rs
src/libstd/cmp.rs
src/libstd/deque.rs
src/libstd/ebml.rs
src/libstd/flatpipes.rs
src/libstd/oldmap.rs
src/libstd/par.rs
src/libstd/rope.rs
src/libstd/sha1.rs
src/libstd/sort.rs
src/libstd/term.rs
src/libstd/test.rs
src/libstd/time.rs
src/libstd/unicode.rs
src/libsyntax/ast.rs
src/libsyntax/ext/expand.rs
src/libsyntax/parse/prec.rs
src/libsyntax/parse/token.rs
src/libsyntax/print/pp.rs
src/libsyntax/print/pprust.rs
src/test/auxiliary/cci_const.rs
src/test/bench/shootout-nbody.rs
src/test/bench/sudoku.rs
src/test/compile-fail/bad-const-type.rs
src/test/compile-fail/borrowck-assign-to-constants.rs
src/test/compile-fail/const-cast-different-types.rs
src/test/compile-fail/const-cast-wrong-type.rs
src/test/compile-fail/const-recursive.rs
src/test/compile-fail/issue-2478.rs
src/test/compile-fail/issue-3521-2.rs
src/test/compile-fail/issue-3668-2.rs
src/test/compile-fail/issue-3668.rs
src/test/compile-fail/issue-4523.rs
src/test/compile-fail/issue-4968.rs
src/test/compile-fail/regions-in-consts.rs
src/test/run-pass-fulldeps/qquote.rs
src/test/run-pass-fulldeps/quote-tokens.rs
src/test/run-pass/conditional-compile.rs
src/test/run-pass/const-autoderef-newtype.rs
src/test/run-pass/const-autoderef.rs
src/test/run-pass/const-big-enum.rs
src/test/run-pass/const-cast-ptr-int.rs
src/test/run-pass/const-cast.rs
src/test/run-pass/const-const.rs
src/test/run-pass/const-contents.rs
src/test/run-pass/const-cross-crate-const.rs
src/test/run-pass/const-cross-crate-extern.rs
src/test/run-pass/const-deref.rs
src/test/run-pass/const-enum-byref-self.rs
src/test/run-pass/const-enum-byref.rs
src/test/run-pass/const-enum-cast.rs
src/test/run-pass/const-enum-ptr.rs
src/test/run-pass/const-enum-struct.rs
src/test/run-pass/const-enum-struct2.rs
src/test/run-pass/const-enum-structlike.rs
src/test/run-pass/const-enum-tuple.rs
src/test/run-pass/const-enum-tuple2.rs
src/test/run-pass/const-enum-tuplestruct.rs
src/test/run-pass/const-enum-tuplestruct2.rs
src/test/run-pass/const-enum-vec-index.rs
src/test/run-pass/const-enum-vec-ptr.rs
src/test/run-pass/const-enum-vector.rs
src/test/run-pass/const-expr-in-fixed-length-vec.rs
src/test/run-pass/const-expr-in-vec-repeat.rs
src/test/run-pass/const-extern-function.rs
src/test/run-pass/const-fields-and-indexing.rs
src/test/run-pass/const-fn-val.rs
src/test/run-pass/const-negative.rs
src/test/run-pass/const-nullary-enum.rs
src/test/run-pass/const-nullary-univariant-enum.rs
src/test/run-pass/const-rec-and-tup.rs
src/test/run-pass/const-region-ptrs-noncopy.rs
src/test/run-pass/const-region-ptrs.rs
src/test/run-pass/const-str-ptr.rs
src/test/run-pass/const-struct.rs
src/test/run-pass/const-tuple-struct.rs
src/test/run-pass/const-unit-struct.rs
src/test/run-pass/const-vec-of-fns.rs
src/test/run-pass/const-vecs-and-slices.rs
src/test/run-pass/const.rs
src/test/run-pass/consts-in-patterns.rs
src/test/run-pass/explicit-self.rs
src/test/run-pass/export-glob-imports-target.rs
src/test/run-pass/foreign-mod-unused-const.rs
src/test/run-pass/issue-1660.rs
src/test/run-pass/issue-2190-1.rs
src/test/run-pass/issue-2428.rs
src/test/run-pass/item-attributes.rs
src/test/run-pass/mod-merge-hack-inst.rs
src/test/run-pass/mod-merge-hack-template.rs
src/test/run-pass/resolve-issue-2428.rs
src/test/run-pass/shift.rs

index c830648e9dffef6f13888392f1a7f2f9221b2394..d9dc89097d03d88cecbb8928546beaef0018f783 100644 (file)
@@ -41,10 +41,10 @@ unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
     }
 }
 
-const lz_none : c_int = 0x0;   // Huffman-coding only.
-const lz_fast : c_int = 0x1;   // LZ with only one probe
-const lz_norm : c_int = 0x80;  // LZ with 128 probes, "normal"
-const lz_best : c_int = 0xfff; // LZ with 4095 probes, "best"
+static lz_none : c_int = 0x0;   // Huffman-coding only.
+static lz_fast : c_int = 0x1;   // LZ with only one probe
+static lz_norm : c_int = 0x80;  // LZ with 128 probes, "normal"
+static lz_best : c_int = 0xfff; // LZ with 4095 probes, "best"
 
 pub fn deflate_bytes(bytes: &[const u8]) -> ~[u8] {
     do vec::as_const_buf(bytes) |b, len| {
index 3449c5ff4ba4504d63167a03d48cccfe0db498f6..6b25611466321f1ffde788a9e22da5c3c05b4f5d 100644 (file)
@@ -211,11 +211,11 @@ unsafe fn find_segment_for_frame(fp: *Word, segment: *StackSegment)
 
 type Memory = uint;
 
-const task_local_heap: Memory = 1;
-const exchange_heap:   Memory = 2;
-const stack:           Memory = 4;
+static task_local_heap: Memory = 1;
+static exchange_heap:   Memory = 2;
+static stack:           Memory = 4;
 
-const need_cleanup:    Memory = exchange_heap | stack;
+static need_cleanup:    Memory = exchange_heap | stack;
 
 // Walks stack, searching for roots of the requested type, and passes
 // each root to the visitor.
index 64806cd21aaecb9f34b71559e477becf3373601c..f5a97bdaca3ac46897d44fddebd84baf35dd4792 100644 (file)
@@ -25,7 +25,7 @@ pub mod linear {
     use uint;
     use vec;
 
-    const INITIAL_CAPACITY: uint = 32u; // 2^5
+    static INITIAL_CAPACITY: uint = 32u; // 2^5
 
     struct Bucket<K,V> {
         hash: uint,
index 2c624a963b130f86ab48305d2423b4b0079ff693..47eece81ce1c90a90e151dde9999a1de96a1ff93 100644 (file)
@@ -732,52 +732,52 @@ pub mod consts {
     #[cfg(target_os = "win32")]
     pub mod os {
         pub mod c95 {
-            pub const EXIT_FAILURE : int = 1;
-            pub const EXIT_SUCCESS : int = 0;
-            pub const RAND_MAX : int = 32767;
-            pub const EOF : int = -1;
-            pub const SEEK_SET : int = 0;
-            pub const SEEK_CUR : int = 1;
-            pub const SEEK_END : int = 2;
-            pub const _IOFBF : int = 0;
-            pub const _IONBF : int = 4;
-            pub const _IOLBF : int = 64;
-            pub const BUFSIZ : uint = 512_u;
-            pub const FOPEN_MAX : uint = 20_u;
-            pub const FILENAME_MAX : uint = 260_u;
-            pub const L_tmpnam : uint = 16_u;
-            pub const TMP_MAX : uint = 32767_u;
+            pub static EXIT_FAILURE : int = 1;
+            pub static EXIT_SUCCESS : int = 0;
+            pub static RAND_MAX : int = 32767;
+            pub static EOF : int = -1;
+            pub static SEEK_SET : int = 0;
+            pub static SEEK_CUR : int = 1;
+            pub static SEEK_END : int = 2;
+            pub static _IOFBF : int = 0;
+            pub static _IONBF : int = 4;
+            pub static _IOLBF : int = 64;
+            pub static BUFSIZ : uint = 512_u;
+            pub static FOPEN_MAX : uint = 20_u;
+            pub static FILENAME_MAX : uint = 260_u;
+            pub static L_tmpnam : uint = 16_u;
+            pub static TMP_MAX : uint = 32767_u;
         }
         pub mod c99 {
         }
         pub mod posix88 {
-            pub const O_RDONLY : int = 0;
-            pub const O_WRONLY : int = 1;
-            pub const O_RDWR : int = 2;
-            pub const O_APPEND : int = 8;
-            pub const O_CREAT : int = 256;
-            pub const O_EXCL : int = 1024;
-            pub const O_TRUNC : int = 512;
-            pub const S_IFIFO : int = 4096;
-            pub const S_IFCHR : int = 8192;
-            pub const S_IFBLK : int = 12288;
-            pub const S_IFDIR : int = 16384;
-            pub const S_IFREG : int = 32768;
-            pub const S_IFMT : int = 61440;
-            pub const S_IEXEC : int = 64;
-            pub const S_IWRITE : int = 128;
-            pub const S_IREAD : int = 256;
-            pub const S_IRWXU : int = 448;
-            pub const S_IXUSR : int = 64;
-            pub const S_IWUSR : int = 128;
-            pub const S_IRUSR : int = 256;
-            pub const F_OK : int = 0;
-            pub const R_OK : int = 4;
-            pub const W_OK : int = 2;
-            pub const X_OK : int = 1;
-            pub const STDIN_FILENO : int = 0;
-            pub const STDOUT_FILENO : int = 1;
-            pub const STDERR_FILENO : int = 2;
+            pub static O_RDONLY : int = 0;
+            pub static O_WRONLY : int = 1;
+            pub static O_RDWR : int = 2;
+            pub static O_APPEND : int = 8;
+            pub static O_CREAT : int = 256;
+            pub static O_EXCL : int = 1024;
+            pub static O_TRUNC : int = 512;
+            pub static S_IFIFO : int = 4096;
+            pub static S_IFCHR : int = 8192;
+            pub static S_IFBLK : int = 12288;
+            pub static S_IFDIR : int = 16384;
+            pub static S_IFREG : int = 32768;
+            pub static S_IFMT : int = 61440;
+            pub static S_IEXEC : int = 64;
+            pub static S_IWRITE : int = 128;
+            pub static S_IREAD : int = 256;
+            pub static S_IRWXU : int = 448;
+            pub static S_IXUSR : int = 64;
+            pub static S_IWUSR : int = 128;
+            pub static S_IRUSR : int = 256;
+            pub static F_OK : int = 0;
+            pub static R_OK : int = 4;
+            pub static W_OK : int = 2;
+            pub static X_OK : int = 1;
+            pub static STDIN_FILENO : int = 0;
+            pub static STDOUT_FILENO : int = 1;
+            pub static STDERR_FILENO : int = 2;
         }
         pub mod posix01 {
         }
@@ -786,13 +786,13 @@ pub mod posix08 {
         pub mod bsd44 {
         }
         pub mod extra {
-            pub const O_TEXT : int = 16384;
-            pub const O_BINARY : int = 32768;
-            pub const O_NOINHERIT: int = 128;
+            pub static O_TEXT : int = 16384;
+            pub static O_BINARY : int = 32768;
+            pub static O_NOINHERIT: int = 128;
 
-            pub const ERROR_SUCCESS : int = 0;
-            pub const ERROR_INSUFFICIENT_BUFFER : int = 122;
-            pub const INVALID_HANDLE_VALUE: int = -1;
+            pub static ERROR_SUCCESS : int = 0;
+            pub static ERROR_INSUFFICIENT_BUFFER : int = 122;
+            pub static INVALID_HANDLE_VALUE: int = -1;
         }
     }
 
@@ -801,56 +801,56 @@ pub mod extra {
     #[cfg(target_os = "android")]
     pub mod os {
         pub mod c95 {
-            pub const EXIT_FAILURE : int = 1;
-            pub const EXIT_SUCCESS : int = 0;
-            pub const RAND_MAX : int = 2147483647;
-            pub const EOF : int = -1;
-            pub const SEEK_SET : int = 0;
-            pub const SEEK_CUR : int = 1;
-            pub const SEEK_END : int = 2;
-            pub const _IOFBF : int = 0;
-            pub const _IONBF : int = 2;
-            pub const _IOLBF : int = 1;
-            pub const BUFSIZ : uint = 8192_u;
-            pub const FOPEN_MAX : uint = 16_u;
-            pub const FILENAME_MAX : uint = 4096_u;
-            pub const L_tmpnam : uint = 20_u;
-            pub const TMP_MAX : uint = 238328_u;
+            pub static EXIT_FAILURE : int = 1;
+            pub static EXIT_SUCCESS : int = 0;
+            pub static RAND_MAX : int = 2147483647;
+            pub static EOF : int = -1;
+            pub static SEEK_SET : int = 0;
+            pub static SEEK_CUR : int = 1;
+            pub static SEEK_END : int = 2;
+            pub static _IOFBF : int = 0;
+            pub static _IONBF : int = 2;
+            pub static _IOLBF : int = 1;
+            pub static BUFSIZ : uint = 8192_u;
+            pub static FOPEN_MAX : uint = 16_u;
+            pub static FILENAME_MAX : uint = 4096_u;
+            pub static L_tmpnam : uint = 20_u;
+            pub static TMP_MAX : uint = 238328_u;
         }
         pub mod c99 {
         }
         pub mod posix88 {
-            pub const O_RDONLY : int = 0;
-            pub const O_WRONLY : int = 1;
-            pub const O_RDWR : int = 2;
-            pub const O_APPEND : int = 1024;
-            pub const O_CREAT : int = 64;
-            pub const O_EXCL : int = 128;
-            pub const O_TRUNC : int = 512;
-            pub const S_IFIFO : int = 4096;
-            pub const S_IFCHR : int = 8192;
-            pub const S_IFBLK : int = 24576;
-            pub const S_IFDIR : int = 16384;
-            pub const S_IFREG : int = 32768;
-            pub const S_IFMT : int = 61440;
-            pub const S_IEXEC : int = 64;
-            pub const S_IWRITE : int = 128;
-            pub const S_IREAD : int = 256;
-            pub const S_IRWXU : int = 448;
-            pub const S_IXUSR : int = 64;
-            pub const S_IWUSR : int = 128;
-            pub const S_IRUSR : int = 256;
-            pub const F_OK : int = 0;
-            pub const R_OK : int = 4;
-            pub const W_OK : int = 2;
-            pub const X_OK : int = 1;
-            pub const STDIN_FILENO : int = 0;
-            pub const STDOUT_FILENO : int = 1;
-            pub const STDERR_FILENO : int = 2;
-            pub const F_LOCK : int = 1;
-            pub const F_TEST : int = 3;
-            pub const F_TLOCK : int = 2;
-            pub const F_ULOCK : int = 0;
+            pub static O_RDONLY : int = 0;
+            pub static O_WRONLY : int = 1;
+            pub static O_RDWR : int = 2;
+            pub static O_APPEND : int = 1024;
+            pub static O_CREAT : int = 64;
+            pub static O_EXCL : int = 128;
+            pub static O_TRUNC : int = 512;
+            pub static S_IFIFO : int = 4096;
+            pub static S_IFCHR : int = 8192;
+            pub static S_IFBLK : int = 24576;
+            pub static S_IFDIR : int = 16384;
+            pub static S_IFREG : int = 32768;
+            pub static S_IFMT : int = 61440;
+            pub static S_IEXEC : int = 64;
+            pub static S_IWRITE : int = 128;
+            pub static S_IREAD : int = 256;
+            pub static S_IRWXU : int = 448;
+            pub static S_IXUSR : int = 64;
+            pub static S_IWUSR : int = 128;
+            pub static S_IRUSR : int = 256;
+            pub static F_OK : int = 0;
+            pub static R_OK : int = 4;
+            pub static W_OK : int = 2;
+            pub static X_OK : int = 1;
+            pub static STDIN_FILENO : int = 0;
+            pub static STDOUT_FILENO : int = 1;
+            pub static STDERR_FILENO : int = 2;
+            pub static F_LOCK : int = 1;
+            pub static F_TEST : int = 3;
+            pub static F_TLOCK : int = 2;
+            pub static F_ULOCK : int = 0;
         }
         pub mod posix01 {
         }
@@ -859,65 +859,65 @@ pub mod posix08 {
         pub mod bsd44 {
         }
         pub mod extra {
-            pub const O_RSYNC : int = 1052672;
-            pub const O_DSYNC : int = 4096;
-            pub const O_SYNC : int = 1052672;
+            pub static O_RSYNC : int = 1052672;
+            pub static O_DSYNC : int = 4096;
+            pub static O_SYNC : int = 1052672;
         }
     }
 
     #[cfg(target_os = "freebsd")]
     pub mod os {
         pub mod c95 {
-            pub const EXIT_FAILURE : int = 1;
-            pub const EXIT_SUCCESS : int = 0;
-            pub const RAND_MAX : int = 2147483647;
-            pub const EOF : int = -1;
-            pub const SEEK_SET : int = 0;
-            pub const SEEK_CUR : int = 1;
-            pub const SEEK_END : int = 2;
-            pub const _IOFBF : int = 0;
-            pub const _IONBF : int = 2;
-            pub const _IOLBF : int = 1;
-            pub const BUFSIZ : uint = 1024_u;
-            pub const FOPEN_MAX : uint = 20_u;
-            pub const FILENAME_MAX : uint = 1024_u;
-            pub const L_tmpnam : uint = 1024_u;
-            pub const TMP_MAX : uint = 308915776_u;
+            pub static EXIT_FAILURE : int = 1;
+            pub static EXIT_SUCCESS : int = 0;
+            pub static RAND_MAX : int = 2147483647;
+            pub static EOF : int = -1;
+            pub static SEEK_SET : int = 0;
+            pub static SEEK_CUR : int = 1;
+            pub static SEEK_END : int = 2;
+            pub static _IOFBF : int = 0;
+            pub static _IONBF : int = 2;
+            pub static _IOLBF : int = 1;
+            pub static BUFSIZ : uint = 1024_u;
+            pub static FOPEN_MAX : uint = 20_u;
+            pub static FILENAME_MAX : uint = 1024_u;
+            pub static L_tmpnam : uint = 1024_u;
+            pub static TMP_MAX : uint = 308915776_u;
         }
         pub mod c99 {
         }
         pub mod posix88 {
-            pub const O_RDONLY : int = 0;
-            pub const O_WRONLY : int = 1;
-            pub const O_RDWR : int = 2;
-            pub const O_APPEND : int = 8;
-            pub const O_CREAT : int = 512;
-            pub const O_EXCL : int = 2048;
-            pub const O_TRUNC : int = 1024;
-            pub const S_IFIFO : int = 4096;
-            pub const S_IFCHR : int = 8192;
-            pub const S_IFBLK : int = 24576;
-            pub const S_IFDIR : int = 16384;
-            pub const S_IFREG : int = 32768;
-            pub const S_IFMT : int = 61440;
-            pub const S_IEXEC : int = 64;
-            pub const S_IWRITE : int = 128;
-            pub const S_IREAD : int = 256;
-            pub const S_IRWXU : int = 448;
-            pub const S_IXUSR : int = 64;
-            pub const S_IWUSR : int = 128;
-            pub const S_IRUSR : int = 256;
-            pub const F_OK : int = 0;
-            pub const R_OK : int = 4;
-            pub const W_OK : int = 2;
-            pub const X_OK : int = 1;
-            pub const STDIN_FILENO : int = 0;
-            pub const STDOUT_FILENO : int = 1;
-            pub const STDERR_FILENO : int = 2;
-            pub const F_LOCK : int = 1;
-            pub const F_TEST : int = 3;
-            pub const F_TLOCK : int = 2;
-            pub const F_ULOCK : int = 0;
+            pub static O_RDONLY : int = 0;
+            pub static O_WRONLY : int = 1;
+            pub static O_RDWR : int = 2;
+            pub static O_APPEND : int = 8;
+            pub static O_CREAT : int = 512;
+            pub static O_EXCL : int = 2048;
+            pub static O_TRUNC : int = 1024;
+            pub static S_IFIFO : int = 4096;
+            pub static S_IFCHR : int = 8192;
+            pub static S_IFBLK : int = 24576;
+            pub static S_IFDIR : int = 16384;
+            pub static S_IFREG : int = 32768;
+            pub static S_IFMT : int = 61440;
+            pub static S_IEXEC : int = 64;
+            pub static S_IWRITE : int = 128;
+            pub static S_IREAD : int = 256;
+            pub static S_IRWXU : int = 448;
+            pub static S_IXUSR : int = 64;
+            pub static S_IWUSR : int = 128;
+            pub static S_IRUSR : int = 256;
+            pub static F_OK : int = 0;
+            pub static R_OK : int = 4;
+            pub static W_OK : int = 2;
+            pub static X_OK : int = 1;
+            pub static STDIN_FILENO : int = 0;
+            pub static STDOUT_FILENO : int = 1;
+            pub static STDERR_FILENO : int = 2;
+            pub static F_LOCK : int = 1;
+            pub static F_TEST : int = 3;
+            pub static F_TLOCK : int = 2;
+            pub static F_ULOCK : int = 0;
         }
         pub mod posix01 {
         }
@@ -926,66 +926,66 @@ pub mod posix08 {
         pub mod bsd44 {
         }
         pub mod extra {
-            pub const O_SYNC : int = 128;
-            pub const CTL_KERN: int = 1;
-            pub const KERN_PROC: int = 14;
-            pub const KERN_PROC_PATHNAME: int = 12;
+            pub static O_SYNC : int = 128;
+            pub static CTL_KERN: int = 1;
+            pub static KERN_PROC: int = 14;
+            pub static KERN_PROC_PATHNAME: int = 12;
         }
     }
 
     #[cfg(target_os = "macos")]
     pub mod os {
         pub mod c95 {
-            pub const EXIT_FAILURE : int = 1;
-            pub const EXIT_SUCCESS : int = 0;
-            pub const RAND_MAX : int = 2147483647;
-            pub const EOF : int = -1;
-            pub const SEEK_SET : int = 0;
-            pub const SEEK_CUR : int = 1;
-            pub const SEEK_END : int = 2;
-            pub const _IOFBF : int = 0;
-            pub const _IONBF : int = 2;
-            pub const _IOLBF : int = 1;
-            pub const BUFSIZ : uint = 1024_u;
-            pub const FOPEN_MAX : uint = 20_u;
-            pub const FILENAME_MAX : uint = 1024_u;
-            pub const L_tmpnam : uint = 1024_u;
-            pub const TMP_MAX : uint = 308915776_u;
+            pub static EXIT_FAILURE : int = 1;
+            pub static EXIT_SUCCESS : int = 0;
+            pub static RAND_MAX : int = 2147483647;
+            pub static EOF : int = -1;
+            pub static SEEK_SET : int = 0;
+            pub static SEEK_CUR : int = 1;
+            pub static SEEK_END : int = 2;
+            pub static _IOFBF : int = 0;
+            pub static _IONBF : int = 2;
+            pub static _IOLBF : int = 1;
+            pub static BUFSIZ : uint = 1024_u;
+            pub static FOPEN_MAX : uint = 20_u;
+            pub static FILENAME_MAX : uint = 1024_u;
+            pub static L_tmpnam : uint = 1024_u;
+            pub static TMP_MAX : uint = 308915776_u;
         }
         pub mod c99 {
         }
         pub mod posix88 {
-            pub const O_RDONLY : int = 0;
-            pub const O_WRONLY : int = 1;
-            pub const O_RDWR : int = 2;
-            pub const O_APPEND : int = 8;
-            pub const O_CREAT : int = 512;
-            pub const O_EXCL : int = 2048;
-            pub const O_TRUNC : int = 1024;
-            pub const S_IFIFO : int = 4096;
-            pub const S_IFCHR : int = 8192;
-            pub const S_IFBLK : int = 24576;
-            pub const S_IFDIR : int = 16384;
-            pub const S_IFREG : int = 32768;
-            pub const S_IFMT : int = 61440;
-            pub const S_IEXEC : int = 64;
-            pub const S_IWRITE : int = 128;
-            pub const S_IREAD : int = 256;
-            pub const S_IRWXU : int = 448;
-            pub const S_IXUSR : int = 64;
-            pub const S_IWUSR : int = 128;
-            pub const S_IRUSR : int = 256;
-            pub const F_OK : int = 0;
-            pub const R_OK : int = 4;
-            pub const W_OK : int = 2;
-            pub const X_OK : int = 1;
-            pub const STDIN_FILENO : int = 0;
-            pub const STDOUT_FILENO : int = 1;
-            pub const STDERR_FILENO : int = 2;
-            pub const F_LOCK : int = 1;
-            pub const F_TEST : int = 3;
-            pub const F_TLOCK : int = 2;
-            pub const F_ULOCK : int = 0;
+            pub static O_RDONLY : int = 0;
+            pub static O_WRONLY : int = 1;
+            pub static O_RDWR : int = 2;
+            pub static O_APPEND : int = 8;
+            pub static O_CREAT : int = 512;
+            pub static O_EXCL : int = 2048;
+            pub static O_TRUNC : int = 1024;
+            pub static S_IFIFO : int = 4096;
+            pub static S_IFCHR : int = 8192;
+            pub static S_IFBLK : int = 24576;
+            pub static S_IFDIR : int = 16384;
+            pub static S_IFREG : int = 32768;
+            pub static S_IFMT : int = 61440;
+            pub static S_IEXEC : int = 64;
+            pub static S_IWRITE : int = 128;
+            pub static S_IREAD : int = 256;
+            pub static S_IRWXU : int = 448;
+            pub static S_IXUSR : int = 64;
+            pub static S_IWUSR : int = 128;
+            pub static S_IRUSR : int = 256;
+            pub static F_OK : int = 0;
+            pub static R_OK : int = 4;
+            pub static W_OK : int = 2;
+            pub static X_OK : int = 1;
+            pub static STDIN_FILENO : int = 0;
+            pub static STDOUT_FILENO : int = 1;
+            pub static STDERR_FILENO : int = 2;
+            pub static F_LOCK : int = 1;
+            pub static F_TEST : int = 3;
+            pub static F_TLOCK : int = 2;
+            pub static F_ULOCK : int = 0;
         }
         pub mod posix01 {
         }
@@ -994,9 +994,9 @@ pub mod posix08 {
         pub mod bsd44 {
         }
         pub mod extra {
-            pub const O_DSYNC : int = 4194304;
-            pub const O_SYNC : int = 128;
-            pub const F_FULLFSYNC : int = 51;
+            pub static O_DSYNC : int = 4194304;
+            pub static O_SYNC : int = 128;
+            pub static F_FULLFSYNC : int = 51;
         }
     }
 }
index 30ebeda3f5cdc1f089d61f9c9beb617de741188a..4eda5e7b5e8c6459f982c43839b0dee3b53677bd 100644 (file)
@@ -16,9 +16,9 @@
 
 pub mod raw {
 
-    pub const RC_EXCHANGE_UNIQUE : uint = (-1) as uint;
-    pub const RC_MANAGED_UNIQUE : uint = (-2) as uint;
-    pub const RC_IMMORTAL : uint = 0x77777777;
+    pub static RC_EXCHANGE_UNIQUE : uint = (-1) as uint;
+    pub static RC_MANAGED_UNIQUE : uint = (-2) as uint;
+    pub static RC_IMMORTAL : uint = 0x77777777;
 
     use intrinsic::TyDesc;
 
index 2f9d4304cba70d0f0fe0b43fb4737fc48fd428df..378ebfa53a0c25a985eb9445d50ba2b7279430ac 100644 (file)
@@ -174,33 +174,33 @@ pub mod c_float_utils {
 // FIXME obtain machine float/math constants automatically (Issue #1986)
 
 pub mod c_float_targ_consts {
-    pub const radix: uint = 2u;
-    pub const mantissa_digits: uint = 24u;
-    pub const digits: uint = 6u;
-    pub const min_exp: uint = -125u;
-    pub const max_exp: uint = 128u;
-    pub const min_10_exp: int = -37;
-    pub const max_10_exp: int = 38;
-    // FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
+    pub static radix: uint = 2u;
+    pub static mantissa_digits: uint = 24u;
+    pub static digits: uint = 6u;
+    pub static min_exp: uint = -125u;
+    pub static max_exp: uint = 128u;
+    pub static min_10_exp: int = -37;
+    pub static max_10_exp: int = 38;
+    // FIXME (#1433): this is wrong, replace with hexadecimal (%a) staticants
     // below.
-    pub const min_value: f32 = 1.175494e-38_f32;
-    pub const max_value: f32 = 3.402823e+38_f32;
-    pub const epsilon: f32 = 0.000000_f32;
+    pub static min_value: f32 = 1.175494e-38_f32;
+    pub static max_value: f32 = 3.402823e+38_f32;
+    pub static epsilon: f32 = 0.000000_f32;
 }
 
 pub mod c_double_targ_consts {
-    pub const radix: uint = 2u;
-    pub const mantissa_digits: uint = 53u;
-    pub const digits: uint = 15u;
-    pub const min_exp: uint = -1021u;
-    pub const max_exp: uint = 1024u;
-    pub const min_10_exp: int = -307;
-    pub const max_10_exp: int = 308;
-    // FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
+    pub static radix: uint = 2u;
+    pub static mantissa_digits: uint = 53u;
+    pub static digits: uint = 15u;
+    pub static min_exp: uint = -1021u;
+    pub static max_exp: uint = 1024u;
+    pub static min_10_exp: int = -307;
+    pub static max_10_exp: int = 308;
+    // FIXME (#1433): this is wrong, replace with hexadecimal (%a) staticants
     // below.
-    pub const min_value: f64 = 2.225074e-308_f64;
-    pub const max_value: f64 = 1.797693e+308_f64;
-    pub const epsilon: f64 = 2.220446e-16_f64;
+    pub static min_value: f64 = 2.225074e-308_f64;
+    pub static max_value: f64 = 1.797693e+308_f64;
+    pub static epsilon: f64 = 2.220446e-16_f64;
 }
 
 /*
@@ -208,61 +208,61 @@ pub mod c_double_targ_consts {
 FIXME use these once they can be parsed (see Issue #1433)
 
 pub mod c_float_math_consts {
-    pub const pi: c_float = 0x1.921fb6p+1_f32;
-    pub const div_1_pi: c_float = 0x1.45f306p-2_f32;
-    pub const div_2_pi: c_float = 0x1.45f306p-1_f32;
-    pub const div_pi_2: c_float = 0x1.921fb6p+0_f32;
-    pub const div_pi_4: c_float = 0x1.921fb6p-1_f32;
-    pub const div_2_sqrtpi: c_float = 0x1.20dd76p+0_f32;
-    pub const e: c_float = 0x1.5bf0a8p+1_f32;
-    pub const log2_e: c_float = 0x1.715476p+0_f32;
-    pub const log10_e: c_float = 0x1.bcb7b2p-2_f32;
-    pub const ln_2: c_float = 0x1.62e43p-1_f32;
-    pub const ln_10: c_float = 0x1.26bb1cp+1_f32;
-    pub const sqrt2: c_float = 0x1.6a09e6p+0_f32;
-    pub const div_1_sqrt2: c_float = 0x1.6a09e6p-1_f32;
+    pub static pi: c_float = 0x1.921fb6p+1_f32;
+    pub static div_1_pi: c_float = 0x1.45f306p-2_f32;
+    pub static div_2_pi: c_float = 0x1.45f306p-1_f32;
+    pub static div_pi_2: c_float = 0x1.921fb6p+0_f32;
+    pub static div_pi_4: c_float = 0x1.921fb6p-1_f32;
+    pub static div_2_sqrtpi: c_float = 0x1.20dd76p+0_f32;
+    pub static e: c_float = 0x1.5bf0a8p+1_f32;
+    pub static log2_e: c_float = 0x1.715476p+0_f32;
+    pub static log10_e: c_float = 0x1.bcb7b2p-2_f32;
+    pub static ln_2: c_float = 0x1.62e43p-1_f32;
+    pub static ln_10: c_float = 0x1.26bb1cp+1_f32;
+    pub static sqrt2: c_float = 0x1.6a09e6p+0_f32;
+    pub static div_1_sqrt2: c_float = 0x1.6a09e6p-1_f32;
 }
 
 pub mod c_double_math_consts {
-    pub const pi: c_double = 0x1.921fb54442d18p+1_f64;
-    pub const div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64;
-    pub const div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64;
-    pub const div_pi_2: c_double = 0x1.921fb54442d18p+0_f64;
-    pub const div_pi_4: c_double = 0x1.921fb54442d18p-1_f64;
-    pub const div_2_sqrtpi: c_double = 0x1.20dd750429b6dp+0_f64;
-    pub const e: c_double = 0x1.5bf0a8b145769p+1_f64;
-    pub const log2_e: c_double = 0x1.71547652b82fep+0_f64;
-    pub const log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
-    pub const ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
-    pub const ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
-    pub const sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
-    pub const div_1_sqrt2: c_double = 0x1.6a09e667f3bcdp-1_f64;
+    pub static pi: c_double = 0x1.921fb54442d18p+1_f64;
+    pub static div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64;
+    pub static div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64;
+    pub static div_pi_2: c_double = 0x1.921fb54442d18p+0_f64;
+    pub static div_pi_4: c_double = 0x1.921fb54442d18p-1_f64;
+    pub static div_2_sqrtpi: c_double = 0x1.20dd750429b6dp+0_f64;
+    pub static e: c_double = 0x1.5bf0a8b145769p+1_f64;
+    pub static log2_e: c_double = 0x1.71547652b82fep+0_f64;
+    pub static log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
+    pub static ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
+    pub static ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
+    pub static sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
+    pub static div_1_sqrt2: c_double = 0x1.6a09e667f3bcdp-1_f64;
 }
 
 pub mod c_float_targ_consts {
-    pub const radix: uint = 2u;
-    pub const mantissa_digits: uint = 24u;
-    pub const digits: uint = 6u;
-    pub const min_exp: int = -125;
-    pub const max_exp: int = 128;
-    pub const min_10_exp: int = -37;
-    pub const max_10_exp: int = 38;
-    pub const min_value: c_float = 0x1p-126_f32;
-    pub const max_value: c_float = 0x1.fffffep+127_f32;
-    pub const epsilon: c_float = 0x1p-23_f32;
+    pub static radix: uint = 2u;
+    pub static mantissa_digits: uint = 24u;
+    pub static digits: uint = 6u;
+    pub static min_exp: int = -125;
+    pub static max_exp: int = 128;
+    pub static min_10_exp: int = -37;
+    pub static max_10_exp: int = 38;
+    pub static min_value: c_float = 0x1p-126_f32;
+    pub static max_value: c_float = 0x1.fffffep+127_f32;
+    pub static epsilon: c_float = 0x1p-23_f32;
 }
 
 pub mod c_double_targ_consts {
-    pub const radix: uint = 2u;
-    pub const mantissa_digits: uint = 53u;
-    pub const digits: uint = 15u;
-    pub const min_exp: int = -1021;
-    pub const max_exp: int = 1024;
-    pub const min_10_exp: int = -307;
-    pub const max_10_exp: int = 308;
-    pub const min_value: c_double = 0x1p-1022_f64;
-    pub const max_value: c_double = 0x1.fffffffffffffp+1023_f64;
-    pub const epsilon: c_double = 0x1p-52_f64;
+    pub static radix: uint = 2u;
+    pub static mantissa_digits: uint = 53u;
+    pub static digits: uint = 15u;
+    pub static min_exp: int = -1021;
+    pub static max_exp: int = 1024;
+    pub static min_10_exp: int = -307;
+    pub static max_10_exp: int = 308;
+    pub static min_value: c_double = 0x1p-1022_f64;
+    pub static max_value: c_double = 0x1.fffffffffffffp+1023_f64;
+    pub static epsilon: c_double = 0x1p-52_f64;
 }
 
 */
index 719e5620d02ca70d8e33e2a057b8695aa66634a0..4a8649fb66e78abefb18059e6d92a87acf71f0bd 100644 (file)
@@ -102,11 +102,11 @@ pub fn $name($( $arg : $arg_ty ),*) -> $rv {
 // These are not defined inside consts:: for consistency with
 // the integer types
 
-pub const NaN: f32 = 0.0_f32/0.0_f32;
+pub static NaN: f32 = 0.0_f32/0.0_f32;
 
-pub const infinity: f32 = 1.0_f32/0.0_f32;
+pub static infinity: f32 = 1.0_f32/0.0_f32;
 
-pub const neg_infinity: f32 = -1.0_f32/0.0_f32;
+pub static neg_infinity: f32 = -1.0_f32/0.0_f32;
 
 #[inline(always)]
 pub fn is_NaN(f: f32) -> bool { f != f }
@@ -206,45 +206,45 @@ pub fn is_finite(x: f32) -> bool {
 /* Module: consts */
 pub mod consts {
     // FIXME (requires Issue #1433 to fix): replace with mathematical
-    // constants from cmath.
-    /// Archimedes' constant
-    pub const pi: f32 = 3.14159265358979323846264338327950288_f32;
+    // staticants from cmath.
+    /// Archimedes' staticant
+    pub static pi: f32 = 3.14159265358979323846264338327950288_f32;
 
     /// pi/2.0
-    pub const frac_pi_2: f32 = 1.57079632679489661923132169163975144_f32;
+    pub static frac_pi_2: f32 = 1.57079632679489661923132169163975144_f32;
 
     /// pi/4.0
-    pub const frac_pi_4: f32 = 0.785398163397448309615660845819875721_f32;
+    pub static frac_pi_4: f32 = 0.785398163397448309615660845819875721_f32;
 
     /// 1.0/pi
-    pub const frac_1_pi: f32 = 0.318309886183790671537767526745028724_f32;
+    pub static frac_1_pi: f32 = 0.318309886183790671537767526745028724_f32;
 
     /// 2.0/pi
-    pub const frac_2_pi: f32 = 0.636619772367581343075535053490057448_f32;
+    pub static frac_2_pi: f32 = 0.636619772367581343075535053490057448_f32;
 
     /// 2.0/sqrt(pi)
-    pub const frac_2_sqrtpi: f32 = 1.12837916709551257389615890312154517_f32;
+    pub static frac_2_sqrtpi: f32 = 1.12837916709551257389615890312154517_f32;
 
     /// sqrt(2.0)
-    pub const sqrt2: f32 = 1.41421356237309504880168872420969808_f32;
+    pub static sqrt2: f32 = 1.41421356237309504880168872420969808_f32;
 
     /// 1.0/sqrt(2.0)
-    pub const frac_1_sqrt2: f32 = 0.707106781186547524400844362104849039_f32;
+    pub static frac_1_sqrt2: f32 = 0.707106781186547524400844362104849039_f32;
 
     /// Euler's number
-    pub const e: f32 = 2.71828182845904523536028747135266250_f32;
+    pub static e: f32 = 2.71828182845904523536028747135266250_f32;
 
     /// log2(e)
-    pub const log2_e: f32 = 1.44269504088896340735992468100189214_f32;
+    pub static log2_e: f32 = 1.44269504088896340735992468100189214_f32;
 
     /// log10(e)
-    pub const log10_e: f32 = 0.434294481903251827651128918916605082_f32;
+    pub static log10_e: f32 = 0.434294481903251827651128918916605082_f32;
 
     /// ln(2.0)
-    pub const ln_2: f32 = 0.693147180559945309417232121458176568_f32;
+    pub static ln_2: f32 = 0.693147180559945309417232121458176568_f32;
 
     /// ln(10.0)
-    pub const ln_10: f32 = 2.30258509299404568401799145468436421_f32;
+    pub static ln_10: f32 = 2.30258509299404568401799145468436421_f32;
 }
 
 #[inline(always)]
index 6a581ddfa9424e6f18aa637fc955513279a8d9a9..8107110e977d8c83ebd960dcc84da4b8794631a9 100644 (file)
@@ -113,27 +113,27 @@ pub fn $name($( $arg : $arg_ty ),*) -> $rv {
 // These are not defined inside consts:: for consistency with
 // the integer types
 
-pub const radix: uint = 2u;
+pub static radix: uint = 2u;
 
-pub const mantissa_digits: uint = 53u;
-pub const digits: uint = 15u;
+pub static mantissa_digits: uint = 53u;
+pub static digits: uint = 15u;
 
-pub const epsilon: f64 = 2.2204460492503131e-16_f64;
+pub static epsilon: f64 = 2.2204460492503131e-16_f64;
 
-pub const min_value: f64 = 2.2250738585072014e-308_f64;
-pub const max_value: f64 = 1.7976931348623157e+308_f64;
+pub static min_value: f64 = 2.2250738585072014e-308_f64;
+pub static max_value: f64 = 1.7976931348623157e+308_f64;
 
-pub const min_exp: int = -1021;
-pub const max_exp: int = 1024;
+pub static min_exp: int = -1021;
+pub static max_exp: int = 1024;
 
-pub const min_10_exp: int = -307;
-pub const max_10_exp: int = 308;
+pub static min_10_exp: int = -307;
+pub static max_10_exp: int = 308;
 
-pub const NaN: f64 = 0.0_f64/0.0_f64;
+pub static NaN: f64 = 0.0_f64/0.0_f64;
 
-pub const infinity: f64 = 1.0_f64/0.0_f64;
+pub static infinity: f64 = 1.0_f64/0.0_f64;
 
-pub const neg_infinity: f64 = -1.0_f64/0.0_f64;
+pub static neg_infinity: f64 = -1.0_f64/0.0_f64;
 
 #[inline(always)]
 pub fn is_NaN(f: f64) -> bool { f != f }
@@ -230,43 +230,43 @@ pub mod consts {
     // FIXME (requires Issue #1433 to fix): replace with mathematical
     // constants from cmath.
     /// Archimedes' constant
-    pub const pi: f64 = 3.14159265358979323846264338327950288_f64;
+    pub static pi: f64 = 3.14159265358979323846264338327950288_f64;
 
     /// pi/2.0
-    pub const frac_pi_2: f64 = 1.57079632679489661923132169163975144_f64;
+    pub static frac_pi_2: f64 = 1.57079632679489661923132169163975144_f64;
 
     /// pi/4.0
-    pub const frac_pi_4: f64 = 0.785398163397448309615660845819875721_f64;
+    pub static frac_pi_4: f64 = 0.785398163397448309615660845819875721_f64;
 
     /// 1.0/pi
-    pub const frac_1_pi: f64 = 0.318309886183790671537767526745028724_f64;
+    pub static frac_1_pi: f64 = 0.318309886183790671537767526745028724_f64;
 
     /// 2.0/pi
-    pub const frac_2_pi: f64 = 0.636619772367581343075535053490057448_f64;
+    pub static frac_2_pi: f64 = 0.636619772367581343075535053490057448_f64;
 
     /// 2.0/sqrt(pi)
-    pub const frac_2_sqrtpi: f64 = 1.12837916709551257389615890312154517_f64;
+    pub static frac_2_sqrtpi: f64 = 1.12837916709551257389615890312154517_f64;
 
     /// sqrt(2.0)
-    pub const sqrt2: f64 = 1.41421356237309504880168872420969808_f64;
+    pub static sqrt2: f64 = 1.41421356237309504880168872420969808_f64;
 
     /// 1.0/sqrt(2.0)
-    pub const frac_1_sqrt2: f64 = 0.707106781186547524400844362104849039_f64;
+    pub static frac_1_sqrt2: f64 = 0.707106781186547524400844362104849039_f64;
 
     /// Euler's number
-    pub const e: f64 = 2.71828182845904523536028747135266250_f64;
+    pub static e: f64 = 2.71828182845904523536028747135266250_f64;
 
     /// log2(e)
-    pub const log2_e: f64 = 1.44269504088896340735992468100189214_f64;
+    pub static log2_e: f64 = 1.44269504088896340735992468100189214_f64;
 
     /// log10(e)
-    pub const log10_e: f64 = 0.434294481903251827651128918916605082_f64;
+    pub static log10_e: f64 = 0.434294481903251827651128918916605082_f64;
 
     /// ln(2.0)
-    pub const ln_2: f64 = 0.693147180559945309417232121458176568_f64;
+    pub static ln_2: f64 = 0.693147180559945309417232121458176568_f64;
 
     /// ln(10.0)
-    pub const ln_10: f64 = 2.30258509299404568401799145468436421_f64;
+    pub static ln_10: f64 = 2.30258509299404568401799145468436421_f64;
 }
 
 #[inline(always)]
index 4e9a1b62b6ece4bc20428eb5a97f1ddff637d63a..65a846c6db14962312f1a41a5dca79e4101bd1d8 100644 (file)
 pub use f64::signbit;
 pub use f64::{j0, j1, jn, y0, y1, yn};
 
-pub const NaN: float = 0.0/0.0;
+pub static NaN: float = 0.0/0.0;
 
-pub const infinity: float = 1.0/0.0;
+pub static infinity: float = 1.0/0.0;
 
-pub const neg_infinity: float = -1.0/0.0;
+pub static neg_infinity: float = -1.0/0.0;
 
 /* Module: consts */
 pub mod consts {
     // FIXME (requires Issue #1433 to fix): replace with mathematical
-    // constants from cmath.
-    /// Archimedes' constant
-    pub const pi: float = 3.14159265358979323846264338327950288;
+    // staticants from cmath.
+    /// Archimedes' staticant
+    pub static pi: float = 3.14159265358979323846264338327950288;
 
     /// pi/2.0
-    pub const frac_pi_2: float = 1.57079632679489661923132169163975144;
+    pub static frac_pi_2: float = 1.57079632679489661923132169163975144;
 
     /// pi/4.0
-    pub const frac_pi_4: float = 0.785398163397448309615660845819875721;
+    pub static frac_pi_4: float = 0.785398163397448309615660845819875721;
 
     /// 1.0/pi
-    pub const frac_1_pi: float = 0.318309886183790671537767526745028724;
+    pub static frac_1_pi: float = 0.318309886183790671537767526745028724;
 
     /// 2.0/pi
-    pub const frac_2_pi: float = 0.636619772367581343075535053490057448;
+    pub static frac_2_pi: float = 0.636619772367581343075535053490057448;
 
     /// 2.0/sqrt(pi)
-    pub const frac_2_sqrtpi: float = 1.12837916709551257389615890312154517;
+    pub static frac_2_sqrtpi: float = 1.12837916709551257389615890312154517;
 
     /// sqrt(2.0)
-    pub const sqrt2: float = 1.41421356237309504880168872420969808;
+    pub static sqrt2: float = 1.41421356237309504880168872420969808;
 
     /// 1.0/sqrt(2.0)
-    pub const frac_1_sqrt2: float = 0.707106781186547524400844362104849039;
+    pub static frac_1_sqrt2: float = 0.707106781186547524400844362104849039;
 
     /// Euler's number
-    pub const e: float = 2.71828182845904523536028747135266250;
+    pub static e: float = 2.71828182845904523536028747135266250;
 
     /// log2(e)
-    pub const log2_e: float = 1.44269504088896340735992468100189214;
+    pub static log2_e: float = 1.44269504088896340735992468100189214;
 
     /// log10(e)
-    pub const log10_e: float = 0.434294481903251827651128918916605082;
+    pub static log10_e: float = 0.434294481903251827651128918916605082;
 
     /// ln(2.0)
-    pub const ln_2: float = 0.693147180559945309417232121458176568;
+    pub static ln_2: float = 0.693147180559945309417232121458176568;
 
     /// ln(10.0)
-    pub const ln_10: float = 2.30258509299404568401799145468436421;
+    pub static ln_10: float = 2.30258509299404568401799145468436421;
 }
 
 /*
index 4d5ac92311ef8e02f1024c343b1319364c25407a..af56d3e63051a76f696c1cec9a74268d3d8660ac 100644 (file)
 
 pub use cmp::{min, max};
 
-pub const bits : uint = inst::bits;
-pub const bytes : uint = (inst::bits / 8);
+pub static bits : uint = inst::bits;
+pub static bytes : uint = (inst::bits / 8);
 
-pub const min_value: T = (-1 as T) << (bits - 1);
-pub const max_value: T = min_value - 1 as T;
+pub static min_value: T = (-1 as T) << (bits - 1);
+pub static max_value: T = min_value - 1 as T;
 
 #[inline(always)]
 pub fn add(x: T, y: T) -> T { x + y }
index 9914807c98f6f4408e4b4ac28ed8bd725a5c6632..965b6f86a53d60da339da7877278426dea6b3e5a 100644 (file)
@@ -14,7 +14,7 @@
 
 mod inst {
     pub type T = i16;
-    pub const bits: uint = ::u16::bits;
+    pub static bits: uint = ::u16::bits;
 }
 
 impl NumCast for i16 {
index c02facd47db25a95ddc2c535344191dbf0098009..030bc9c3fdefe84a4113818390823ee80909b8b3 100644 (file)
@@ -14,7 +14,7 @@
 
 mod inst {
     pub type T = i32;
-    pub const bits: uint = ::u32::bits;
+    pub static bits: uint = ::u32::bits;
 }
 
 impl NumCast for i32 {
index c285ba23c27899e444f9a0ba1a21e133f249d8fb..283de94e9d80eb70f1086ed090541db8225ac355 100644 (file)
@@ -14,7 +14,7 @@
 
 mod inst {
     pub type T = i64;
-    pub const bits: uint = ::u64::bits;
+    pub static bits: uint = ::u64::bits;
 }
 
 impl NumCast for i64 {
index 2733a064563269d26b8928f202f5b0dff9419641..2f2de358337b75c2d770ad27faac1cd90e057c4f 100644 (file)
@@ -14,7 +14,7 @@
 
 mod inst {
     pub type T = i8;
-    pub const bits: uint = ::u8::bits;
+    pub static bits: uint = ::u8::bits;
 }
 
 impl NumCast for i8 {
index 29e1e52348eb9eb821a839f209092dfecb13ec6d..3c89492c7e48e04aa52eb939aac357a291305c63 100644 (file)
@@ -16,7 +16,7 @@
 
 mod inst {
     pub type T = int;
-    pub const bits: uint = ::uint::bits;
+    pub static bits: uint = ::uint::bits;
 
     /// Returns `base` raised to the power of `exponent`
     pub fn pow(base: int, exponent: uint) -> int {
index e39d52d86f2cdbf7f784ec39571833d0228636ed..26f0582bfb2bac69787bb2ccc3df607887f3e987 100644 (file)
@@ -394,9 +394,9 @@ pub fn to_str_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+
 
 // Some constants for from_str_bytes_common's input validation,
 // they define minimum radix values for which the character is a valid digit.
-priv const DIGIT_P_RADIX: uint = ('p' as uint) - ('a' as uint) + 11u;
-priv const DIGIT_I_RADIX: uint = ('i' as uint) - ('a' as uint) + 11u;
-priv const DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
+priv static DIGIT_P_RADIX: uint = ('p' as uint) - ('a' as uint) + 11u;
+priv static DIGIT_I_RADIX: uint = ('i' as uint) - ('a' as uint) + 11u;
+priv static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
 
 /**
  * Parses a byte slice as a number. This is meant to
index b8e713ff3aba5d6fc332a9eb36ee8ed36b59807e..41d90cc24826b0a215ed12559e425aa15bad2767 100644 (file)
 
 pub use cmp::{min, max};
 
-pub const bits : uint = inst::bits;
-pub const bytes : uint = (inst::bits / 8);
+pub static bits : uint = inst::bits;
+pub static bytes : uint = (inst::bits / 8);
 
-pub const min_value: T = 0 as T;
-pub const max_value: T = 0 as T - 1 as T;
+pub static min_value: T = 0 as T;
+pub static max_value: T = 0 as T - 1 as T;
 
 #[inline(always)]
 pub fn add(x: T, y: T) -> T { x + y }
index bdd951201362118b8ac79e8b48670297aa2470fb..c73313ac0f34fe2736de8764248599e35dedadde 100644 (file)
@@ -16,7 +16,7 @@ mod inst {
     pub type T = u16;
     #[allow(non_camel_case_types)]
     pub type T_SIGNED = i16;
-    pub const bits: uint = 16;
+    pub static bits: uint = 16;
 }
 
 impl NumCast for u16 {
index 7bef51489f22188f2e4e63b9011f23421111ec5d..eb63f1a370aecb9b4c70372b1075bbce612f9b57 100644 (file)
@@ -16,7 +16,7 @@ mod inst {
     pub type T = u32;
     #[allow(non_camel_case_types)]
     pub type T_SIGNED = i32;
-    pub const bits: uint = 32;
+    pub static bits: uint = 32;
 }
 
 impl NumCast for u32 {
index fecafe37f3d935b93acfaaf050bbfe8228c802b6..799421dc9767f79d134cb140637c4a9661f265f3 100644 (file)
@@ -16,7 +16,7 @@ mod inst {
     pub type T = u64;
     #[allow(non_camel_case_types)]
     pub type T_SIGNED = i64;
-    pub const bits: uint = 64;
+    pub static bits: uint = 64;
 }
 
 impl NumCast for u64 {
index 0d48de67334a525fa9b9583ee1be60265aa641fd..b173d29510c04863cf869a942543b610762285e6 100644 (file)
@@ -18,7 +18,7 @@ mod inst {
     pub type T = u8;
     #[allow(non_camel_case_types)]
     pub type T_SIGNED = i8;
-    pub const bits: uint = 8;
+    pub static bits: uint = 8;
 
     // Type-specific functions here. These must be reexported by the
     // parent module so that they appear in core::u8 and not core::u8::u8;
index f3f27a4e48ab65d44c9be730110c4592ebb5d422..741e0f36a333bf86f86a269b0bccd2f20d46c1c4 100644 (file)
@@ -28,10 +28,10 @@ pub mod inst {
     #[cfg(target_arch = "x86")]
     #[cfg(target_arch = "arm")]
     #[cfg(target_arch = "mips")]
-    pub const bits: uint = 32;
+    pub static bits: uint = 32;
 
     #[cfg(target_arch = "x86_64")]
-    pub const bits: uint = 64;
+    pub static bits: uint = 64;
 
     /**
     * Divide two numbers, return the result, rounded up.
index 17ec9df9d5690f0f69dab344dcefa351ea183b29..3c2dbf7ea15bc9be32dd4631f6b0ea32e0b12941 100644 (file)
@@ -65,8 +65,8 @@ pub mod rustrt {
     }
 }
 
-pub const TMPBUF_SZ : uint = 1000u;
-const BUF_BYTES : uint = 2048u;
+pub static TMPBUF_SZ : uint = 1000u;
+static BUF_BYTES : uint = 2048u;
 
 pub fn getcwd() -> Path {
     let buf = [0 as libc::c_char, ..BUF_BYTES];
@@ -1013,8 +1013,8 @@ unsafe fn FormatMessageA(flags: DWORD, lpSrc: LPVOID,
                                      args: *c_void) -> DWORD;
         }
 
-        const FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000;
-        const FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200;
+        static FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000;
+        static FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200;
 
         let mut buf = [0 as c_char, ..TMPBUF_SZ];
 
@@ -1170,11 +1170,11 @@ pub mod consts {
     pub use os::consts::windows::*;
 
     pub mod unix {
-        pub const FAMILY: &'static str = "unix";
+        pub static FAMILY: &'static str = "unix";
     }
 
     pub mod windows {
-        pub const FAMILY: &'static str = "windows";
+        pub static FAMILY: &'static str = "windows";
     }
 
     #[cfg(target_os = "macos")]
@@ -1193,38 +1193,38 @@ pub mod windows {
     pub use os::consts::win32::*;
 
     pub mod macos {
-        pub const SYSNAME: &'static str = "macos";
-        pub const DLL_PREFIX: &'static str = "lib";
-        pub const DLL_SUFFIX: &'static str = ".dylib";
-        pub const EXE_SUFFIX: &'static str = "";
+        pub static SYSNAME: &'static str = "macos";
+        pub static DLL_PREFIX: &'static str = "lib";
+        pub static DLL_SUFFIX: &'static str = ".dylib";
+        pub static EXE_SUFFIX: &'static str = "";
     }
 
     pub mod freebsd {
-        pub const SYSNAME: &'static str = "freebsd";
-        pub const DLL_PREFIX: &'static str = "lib";
-        pub const DLL_SUFFIX: &'static str = ".so";
-        pub const EXE_SUFFIX: &'static str = "";
+        pub static SYSNAME: &'static str = "freebsd";
+        pub static DLL_PREFIX: &'static str = "lib";
+        pub static DLL_SUFFIX: &'static str = ".so";
+        pub static EXE_SUFFIX: &'static str = "";
     }
 
     pub mod linux {
-        pub const SYSNAME: &'static str = "linux";
-        pub const DLL_PREFIX: &'static str = "lib";
-        pub const DLL_SUFFIX: &'static str = ".so";
-        pub const EXE_SUFFIX: &'static str = "";
+        pub static SYSNAME: &'static str = "linux";
+        pub static DLL_PREFIX: &'static str = "lib";
+        pub static DLL_SUFFIX: &'static str = ".so";
+        pub static EXE_SUFFIX: &'static str = "";
     }
 
     pub mod android {
-        pub const SYSNAME: &'static str = "android";
-        pub const DLL_PREFIX: &'static str = "lib";
-        pub const DLL_SUFFIX: &'static str = ".so";
-        pub const EXE_SUFFIX: &'static str = "";
+        pub static SYSNAME: &'static str = "android";
+        pub static DLL_PREFIX: &'static str = "lib";
+        pub static DLL_SUFFIX: &'static str = ".so";
+        pub static EXE_SUFFIX: &'static str = "";
     }
 
     pub mod win32 {
-        pub const SYSNAME: &'static str = "win32";
-        pub const DLL_PREFIX: &'static str = "";
-        pub const DLL_SUFFIX: &'static str = ".dll";
-        pub const EXE_SUFFIX: &'static str = ".exe";
+        pub static SYSNAME: &'static str = "win32";
+        pub static DLL_PREFIX: &'static str = "";
+        pub static DLL_SUFFIX: &'static str = ".dll";
+        pub static EXE_SUFFIX: &'static str = ".exe";
     }
 
 
@@ -1241,16 +1241,16 @@ pub mod win32 {
     use os::consts::mips::*;
 
     pub mod x86 {
-        pub const ARCH: &'static str = "x86";
+        pub static ARCH: &'static str = "x86";
     }
     pub mod x86_64 {
-        pub const ARCH: &'static str = "x86_64";
+        pub static ARCH: &'static str = "x86_64";
     }
     pub mod arm {
-        pub const ARCH: &'static str = "arm";
+        pub static ARCH: &'static str = "arm";
     }
     pub mod mips {
-        pub const ARCH: &'static str = "mips";
+        pub static ARCH: &'static str = "mips";
     }
 }
 
index 710f2c51ee8c73dbae149d5225fb5db06016a4d3..9cf3e4d6114578ec5adeaf8cebd9b4bd6a1be7e3 100644 (file)
@@ -96,7 +96,7 @@
 use vec;
 
 #[doc(hidden)]
-const SPIN_COUNT: uint = 0;
+static SPIN_COUNT: uint = 0;
 
 macro_rules! move_it (
     { $x:expr } => ( unsafe { let y = *ptr::addr_of(&($x)); y } )
index fbdda02dcdc78e9ecbfe9b004ee1327fc860d427..3085269f692ef843560c3d987625a227c56343a3 100644 (file)
@@ -313,7 +313,7 @@ fn gen_f64(&self) -> f64 {
         let u1 = self.next() as f64;
         let u2 = self.next() as f64;
         let u3 = self.next() as f64;
-        const scale : f64 = (u32::max_value as f64) + 1.0f64;
+        static scale : f64 = (u32::max_value as f64) + 1.0f64;
         return ((u1 / scale + u2) / scale + u3) / scale;
     }
 
index 4150366dacfa32f1142d68acf91b55575c7d117a..4798399d5e9489756292f959f736b7da08c1b306 100644 (file)
@@ -112,10 +112,10 @@ fn initialize_call_frame(regs: &mut Registers,
                          fptr: *c_void, arg: *c_void, sp: *mut uint) {
 
     // Redefinitions from regs.h
-    const RUSTRT_ARG0: uint = 3;
-    const RUSTRT_RSP: uint = 1;
-    const RUSTRT_IP: uint = 8;
-    const RUSTRT_RBP: uint = 2;
+    static RUSTRT_ARG0: uint = 3;
+    static RUSTRT_RSP: uint = 1;
+    static RUSTRT_IP: uint = 8;
+    static RUSTRT_RBP: uint = 2;
 
     let sp = align_down(sp);
     let sp = mut_offset(sp, -1);
index c2c4bedee81edf10cf6ebf3f541977e57f2ad7ec..0beadb30d42c6534c80aecf8f9f557020d9db53b 100644 (file)
@@ -282,7 +282,7 @@ fn task_from_last_cleanup_job(&mut self) -> &mut Task {
     }
 }
 
-const TASK_MIN_STACK_SIZE: uint = 10000000; // XXX: Too much stack
+static TASK_MIN_STACK_SIZE: uint = 10000000; // XXX: Too much stack
 
 pub struct Task {
     /// The task entry point, saved here for later destruction
@@ -481,7 +481,7 @@ fn test_swap_tasks() {
 #[bench] #[test] #[ignore(reason = "long test")]
 fn test_run_a_lot_of_tasks_queued() {
     do run_in_bare_thread {
-        const MAX: int = 1000000;
+        static MAX: int = 1000000;
         let mut count = 0;
         let count_ptr: *mut int = &mut count;
 
@@ -514,7 +514,7 @@ fn run_task(count_ptr: *mut int) {
 #[bench] #[test] #[ignore(reason = "too much stack allocation")]
 fn test_run_a_lot_of_tasks_direct() {
     do run_in_bare_thread {
-        const MAX: int = 100000;
+        static MAX: int = 100000;
         let mut count = 0;
         let count_ptr: *mut int = &mut count;
 
index e10551b6b893b1067acf6e96d644ac2cd82f9448..5af8c79fd635c9439b8c5ce96aa3a238f3038433 100644 (file)
@@ -56,7 +56,7 @@ pub unsafe fn get(key: Key) -> *mut c_void {
 
 #[cfg(windows)]
 pub unsafe fn create(key: &mut Key) {
-    const TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF;
+    static TLS_OUT_OF_INDEXES: DWORD = 0xFFFFFFFF;
     *key = unsafe { TlsAlloc() };
     fail_unless!(*key != TLS_OUT_OF_INDEXES);
 }
index 4d87bdb02e81a4dbe4fa255478459544f50f1831..19ce04bd66b5c577123a55f60cfb58f5ea608e00 100644 (file)
@@ -396,7 +396,7 @@ fn listen(&mut self, cb: ConnectionCallback) {
         data.connect_cb = Some(cb);
 
         unsafe {
-            const BACKLOG: c_int = 128; // XXX should be configurable
+            static BACKLOG: c_int = 128; // XXX should be configurable
             // XXX: This can probably fail
             fail_unless!(0 == uvll::listen(self.native_handle(),
                                            BACKLOG, connection_cb));
@@ -848,7 +848,7 @@ fn connect_read() {
 #[ignore(reason = "ffi struct issues")]
 fn listen() {
     do run_in_bare_thread() {
-        const MAX: int = 10;
+        static MAX: int = 10;
         let mut loop_ = Loop::new();
         let mut server_tcp_watcher = { TcpWatcher::new(&mut loop_) };
         let addr = Ipv4(127, 0, 0, 1, 2925);
index fc4d1e387dd86a75ac7a162fdd9f30d48e8ef880..f26d9ee3492644403fb6e5836df0f2219834f39f 100644 (file)
@@ -1907,26 +1907,26 @@ pub fn any_between(s: &str, start: uint, end: uint,
 }
 
 // UTF-8 tags and ranges
-const tag_cont_u8: u8 = 128u8;
-const tag_cont: uint = 128u;
-const max_one_b: uint = 128u;
-const tag_two_b: uint = 192u;
-const max_two_b: uint = 2048u;
-const tag_three_b: uint = 224u;
-const max_three_b: uint = 65536u;
-const tag_four_b: uint = 240u;
-const max_four_b: uint = 2097152u;
-const tag_five_b: uint = 248u;
-const max_five_b: uint = 67108864u;
-const tag_six_b: uint = 252u;
+static tag_cont_u8: u8 = 128u8;
+static tag_cont: uint = 128u;
+static max_one_b: uint = 128u;
+static tag_two_b: uint = 192u;
+static max_two_b: uint = 2048u;
+static tag_three_b: uint = 224u;
+static max_three_b: uint = 65536u;
+static tag_four_b: uint = 240u;
+static max_four_b: uint = 2097152u;
+static tag_five_b: uint = 248u;
+static max_five_b: uint = 67108864u;
+static tag_six_b: uint = 252u;
 
 // Constants used for converting strs to floats
-pub const inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
-pub const positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8,
-                                      'n' as u8, 'f' as u8];
-pub const negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8,
-                                      'n' as u8, 'f' as u8];
-pub const nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
+pub static inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
+pub static positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8,
+                                       'n' as u8, 'f' as u8];
+pub static negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8,
+                                       'n' as u8, 'f' as u8];
+pub static nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
 
 /**
  * Work with the byte buffer of a string.
index a38b44afb513fe77d596ea75c063fad9499227df..a6646605b752d9433115187c14efbb9e8fd2f1c7 100644 (file)
@@ -1160,7 +1160,7 @@ fn test_child_doesnt_ref_parent() {
     // climbing the task tree to dereference each ancestor. (See #1789)
     // (well, it would if the constant were 8000+ - I lowered it to be more
     // valgrind-friendly. try this at home, instead..!)
-    const generations: uint = 16;
+    static generations: uint = 16;
     fn child_no(x: uint) -> ~fn() {
         return || {
             if x < generations {
index 653e29b62a52caeaa08dcb1b0d3ea1f059e4f927..40ef5fee47aa418e3b13d039ba8a0bcc4d879bb9 100644 (file)
@@ -13,9 +13,9 @@
 use prelude::*;
 
 // FIXME: #5244: need to manually update the TrieNode constructor
-const SHIFT: uint = 4;
-const SIZE: uint = 1 << SHIFT;
-const MASK: uint = SIZE - 1;
+static SHIFT: uint = 4;
+static SIZE: uint = 1 << SHIFT;
+static MASK: uint = SIZE - 1;
 
 enum Child<T> {
     Internal(~TrieNode<T>),
index 2571dca1c96c73c2f0fd2a3057f8e57d65284478..029205f6bfae33cb8fbeb68bf81ffede55616735 100644 (file)
@@ -687,12 +687,12 @@ pub mod rt {
     use uint;
     use vec;
 
-    pub const flag_none : u32 = 0u32;
-    pub const flag_left_justify   : u32 = 0b00000000000001u32;
-    pub const flag_left_zero_pad  : u32 = 0b00000000000010u32;
-    pub const flag_space_for_sign : u32 = 0b00000000000100u32;
-    pub const flag_sign_always    : u32 = 0b00000000001000u32;
-    pub const flag_alternate      : u32 = 0b00000000010000u32;
+    pub static flag_none : u32 = 0u32;
+    pub static flag_left_justify   : u32 = 0b00000000000001u32;
+    pub static flag_left_zero_pad  : u32 = 0b00000000000010u32;
+    pub static flag_space_for_sign : u32 = 0b00000000000100u32;
+    pub static flag_sign_always    : u32 = 0b00000000001000u32;
+    pub static flag_alternate      : u32 = 0b00000000010000u32;
 
     pub enum Count { CountIs(uint), CountImplied, }
 
index 660336055590e66801bfe2d35c5ef904c8a8db44..32e1b35d7db9f2e3002fffc4126190277ab22724 100644 (file)
@@ -159,7 +159,7 @@ fn finalize(&self) {
 
 fn get_global_state() -> Exclusive<GlobalState> {
 
-    const POISON: int = -1;
+    static POISON: int = -1;
 
     // FIXME #4728: Doing atomic_cxchg to initialize the global state
     // lazily, which wouldn't be necessary with a runtime written
index db0b1cc33cd671d11753d634ec8de0276eaade58..ea5dfa0a530c318011a4e29f6035c6a7affa1d64 100644 (file)
@@ -22,9 +22,9 @@
 pub type rust_task = c_void;
 
 #[cfg(target_word_size = "32")]
-pub const FROZEN_BIT: uint = 0x80000000;
+pub static FROZEN_BIT: uint = 0x80000000;
 #[cfg(target_word_size = "64")]
-pub const FROZEN_BIT: uint = 0x8000000000000000;
+pub static FROZEN_BIT: uint = 0x8000000000000000;
 
 pub mod rustrt {
     use libc::{c_char, uintptr_t};
index 7ea74b369404c149190ab11834ed393d2dc3919c..dcf9a493c558a02e82ce04b06e9806518d4fc6c8 100644 (file)
@@ -26,8 +26,8 @@ fn choice<T:copy>(r : rand::rng, v : ~[const T]) -> T {
 fn likelihood(r : rand::rng, k : uint, n : uint) -> bool { under(r, n) < k }
 
 
-const iters : uint = 1000u;
-const vlen  : uint = 100u;
+static iters : uint = 1000u;
+static vlen  : uint = 100u;
 
 enum maybe_pointy {
     none,
index 3ca4ef5efbd9532bba7594de8ecbadb2934a3f8d..2ebc162eb6aeca2d2f65b6d1cee3fd4f6f963b42 100644 (file)
@@ -54,7 +54,7 @@ struct Command {
     usage_full: UsageSource/&self
 }
 
-const commands: &'static [Command/&static] = &[
+static commands: &'static [Command/&static] = &[
     Command{
         cmd: "build",
         action: Exec("rustc"),
@@ -199,7 +199,7 @@ fn do_command(command: &Command, args: &[~str]) -> ValidUsage {
 }
 
 fn usage() {
-    const indent: uint = 8;
+    static indent: uint = 8;
 
     io::print(
         "The rust tool is a convenience for managing rust source code.\n\
index 06625c1ddd96580e9581662f489ec3331b6e0478..70a029ede6f8d78efa63e321c69af5ee223a9035 100644 (file)
 
 
 
-pub const rc_base_field_refcnt: uint = 0u;
+pub static rc_base_field_refcnt: uint = 0u;
 
-pub const task_field_refcnt: uint = 0u;
+pub static task_field_refcnt: uint = 0u;
 
-pub const task_field_stk: uint = 2u;
+pub static task_field_stk: uint = 2u;
 
-pub const task_field_runtime_sp: uint = 3u;
+pub static task_field_runtime_sp: uint = 3u;
 
-pub const task_field_rust_sp: uint = 4u;
+pub static task_field_rust_sp: uint = 4u;
 
-pub const task_field_gc_alloc_chain: uint = 5u;
+pub static task_field_gc_alloc_chain: uint = 5u;
 
-pub const task_field_dom: uint = 6u;
+pub static task_field_dom: uint = 6u;
 
-pub const n_visible_task_fields: uint = 7u;
+pub static n_visible_task_fields: uint = 7u;
 
-pub const dom_field_interrupt_flag: uint = 1u;
+pub static dom_field_interrupt_flag: uint = 1u;
 
-pub const frame_glue_fns_field_mark: uint = 0u;
+pub static frame_glue_fns_field_mark: uint = 0u;
 
-pub const frame_glue_fns_field_drop: uint = 1u;
+pub static frame_glue_fns_field_drop: uint = 1u;
 
-pub const frame_glue_fns_field_reloc: uint = 2u;
+pub static frame_glue_fns_field_reloc: uint = 2u;
 
-pub const box_field_refcnt: uint = 0u;
-pub const box_field_tydesc: uint = 1u;
-pub const box_field_prev: uint = 2u;
-pub const box_field_next: uint = 3u;
-pub const box_field_body: uint = 4u;
+pub static box_field_refcnt: uint = 0u;
+pub static box_field_tydesc: uint = 1u;
+pub static box_field_prev: uint = 2u;
+pub static box_field_next: uint = 3u;
+pub static box_field_body: uint = 4u;
 
-pub const general_code_alignment: uint = 16u;
+pub static general_code_alignment: uint = 16u;
 
-pub const tydesc_field_size: uint = 0u;
-pub const tydesc_field_align: uint = 1u;
-pub const tydesc_field_take_glue: uint = 2u;
-pub const tydesc_field_drop_glue: uint = 3u;
-pub const tydesc_field_free_glue: uint = 4u;
-pub const tydesc_field_visit_glue: uint = 5u;
-pub const tydesc_field_shape: uint = 6u;
-pub const tydesc_field_shape_tables: uint = 7u;
-pub const n_tydesc_fields: uint = 8u;
+pub static tydesc_field_size: uint = 0u;
+pub static tydesc_field_align: uint = 1u;
+pub static tydesc_field_take_glue: uint = 2u;
+pub static tydesc_field_drop_glue: uint = 3u;
+pub static tydesc_field_free_glue: uint = 4u;
+pub static tydesc_field_visit_glue: uint = 5u;
+pub static tydesc_field_shape: uint = 6u;
+pub static tydesc_field_shape_tables: uint = 7u;
+pub static n_tydesc_fields: uint = 8u;
 
 // The two halves of a closure: code and environment.
-pub const fn_field_code: uint = 0u;
-pub const fn_field_box: uint = 1u;
+pub static fn_field_code: uint = 0u;
+pub static fn_field_box: uint = 1u;
 
-pub const vec_elt_fill: uint = 0u;
+pub static vec_elt_fill: uint = 0u;
 
-pub const vec_elt_alloc: uint = 1u;
+pub static vec_elt_alloc: uint = 1u;
 
-pub const vec_elt_elems: uint = 2u;
+pub static vec_elt_elems: uint = 2u;
 
-pub const slice_elt_base: uint = 0u;
-pub const slice_elt_len: uint = 1u;
+pub static slice_elt_base: uint = 0u;
+pub static slice_elt_len: uint = 1u;
 
-pub const worst_case_glue_call_args: uint = 7u;
+pub static worst_case_glue_call_args: uint = 7u;
 
-pub const abi_version: uint = 1u;
+pub static abi_version: uint = 1u;
 
 pub fn memcpy_glue_name() -> ~str { return ~"rust_memcpy_glue"; }
 
index caf4689688b103a32b23855127f4b83f76c7f946..28ebc3f424ef07984591e57aacf7f191c4d3dfdd 100644 (file)
@@ -44,29 +44,29 @@ pub struct config {
     float_type: float_ty
 }
 
-pub const verbose: uint = 1 << 0;
-pub const time_passes: uint = 1 << 1;
-pub const count_llvm_insns: uint = 1 << 2;
-pub const time_llvm_passes: uint = 1 << 3;
-pub const trans_stats: uint = 1 << 4;
-pub const no_asm_comments: uint = 1 << 5;
-pub const no_verify: uint = 1 << 6;
-pub const trace: uint = 1 << 7;
-pub const coherence: uint = 1 << 8;
-pub const borrowck_stats: uint = 1 << 9;
-pub const borrowck_note_pure: uint = 1 << 10;
-pub const borrowck_note_loan: uint = 1 << 11;
-pub const no_landing_pads: uint = 1 << 12;
-pub const debug_llvm: uint = 1 << 13;
-pub const count_type_sizes: uint = 1 << 14;
-pub const meta_stats: uint = 1 << 15;
-pub const no_opt: uint = 1 << 16;
-pub const no_monomorphic_collapse: uint = 1 << 17;
-pub const gc: uint = 1 << 18;
-pub const jit: uint = 1 << 19;
-pub const debug_info: uint = 1 << 20;
-pub const extra_debug_info: uint = 1 << 21;
-pub const static: uint = 1 << 22;
+pub static verbose: uint = 1 << 0;
+pub static time_passes: uint = 1 << 1;
+pub static count_llvm_insns: uint = 1 << 2;
+pub static time_llvm_passes: uint = 1 << 3;
+pub static trans_stats: uint = 1 << 4;
+pub static no_asm_comments: uint = 1 << 5;
+pub static no_verify: uint = 1 << 6;
+pub static trace: uint = 1 << 7;
+pub static coherence: uint = 1 << 8;
+pub static borrowck_stats: uint = 1 << 9;
+pub static borrowck_note_pure: uint = 1 << 10;
+pub static borrowck_note_loan: uint = 1 << 11;
+pub static no_landing_pads: uint = 1 << 12;
+pub static debug_llvm: uint = 1 << 13;
+pub static count_type_sizes: uint = 1 << 14;
+pub static meta_stats: uint = 1 << 15;
+pub static no_opt: uint = 1 << 16;
+pub static no_monomorphic_collapse: uint = 1 << 17;
+pub static gc: uint = 1 << 18;
+pub static jit: uint = 1 << 19;
+pub static debug_info: uint = 1 << 20;
+pub static extra_debug_info: uint = 1 << 21;
+pub static static: uint = 1 << 22;
 
 pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
     ~[(~"verbose", ~"in general, enable more debug printouts", verbose),
index 0766dcd24508618bc9e7681d569947a67e48df86..6e134d25ff2cfb4562e3f231217020cc7964093d 100644 (file)
@@ -19,7 +19,7 @@
 use syntax::codemap::dummy_sp;
 use syntax::fold;
 
-const CORE_VERSION: &'static str = "0.6";
+static CORE_VERSION: &'static str = "0.6";
 
 pub fn maybe_inject_libcore_ref(sess: Session,
                                 crate: @ast::crate) -> @ast::crate {
index d7c1bc9b2d32dfa68306365afb6f8c99d2e249ef..401005310107ddd48a5bad8446a7437cffdac394 100644 (file)
@@ -257,7 +257,7 @@ fn main() {
     std::test::test_main_static(::os::args(), tests)
   }
 
-  const tests : &'static [std::test::TestDescAndFn] = &[
+  static tests : &'static [std::test::TestDescAndFn] = &[
     ... the list of tests in the crate ...
   ];
 }
@@ -360,7 +360,7 @@ fn mk_tests(cx: &TestCtxt) -> @ast::item {
     let test_descs = mk_test_descs(cx);
 
     (quote_item!(
-        pub const tests : &'static [self::std::test::TestDescAndFn] =
+        pub static tests : &'static [self::std::test::TestDescAndFn] =
             $test_descs
         ;
     )).get()
index 5cdfe6a49f723ca5529dc6e067288495bed56461..e01c4ae7d727dc8485ac4fa31154ec4e6718a4cf 100644 (file)
@@ -20,8 +20,8 @@
 pub type Opcode = u32;
 pub type Bool = c_uint;
 
-pub const True: Bool = 1 as Bool;
-pub const False: Bool = 0 as Bool;
+pub static True: Bool = 1 as Bool;
+pub static False: Bool = 0 as Bool;
 
 // Consts for the LLVM CallConv type, pre-cast to uint.
 
index 38b76c4ace29f3180e377268c4553298c50f0f79..920631a55b4ec05ed56051f9cfb5d1456aecae55 100644 (file)
 
 // EBML enum definitions and utils shared by the encoder and decoder
 
-pub const tag_items: uint = 0x02u;
+pub static tag_items: uint = 0x02u;
 
-pub const tag_paths_data_name: uint = 0x04u;
+pub static tag_paths_data_name: uint = 0x04u;
 
-pub const tag_def_id: uint = 0x07u;
+pub static tag_def_id: uint = 0x07u;
 
-pub const tag_items_data: uint = 0x08u;
+pub static tag_items_data: uint = 0x08u;
 
-pub const tag_items_data_item: uint = 0x09u;
+pub static tag_items_data_item: uint = 0x09u;
 
-pub const tag_items_data_item_family: uint = 0x0au;
+pub static tag_items_data_item_family: uint = 0x0au;
 
-pub const tag_items_data_item_ty_param_bounds: uint = 0x0bu;
+pub static tag_items_data_item_ty_param_bounds: uint = 0x0bu;
 
-pub const tag_items_data_item_type: uint = 0x0cu;
+pub static tag_items_data_item_type: uint = 0x0cu;
 
-pub const tag_items_data_item_symbol: uint = 0x0du;
+pub static tag_items_data_item_symbol: uint = 0x0du;
 
-pub const tag_items_data_item_variant: uint = 0x0eu;
+pub static tag_items_data_item_variant: uint = 0x0eu;
 
-pub const tag_items_data_parent_item: uint = 0x0fu;
+pub static tag_items_data_parent_item: uint = 0x0fu;
 
-pub const tag_index: uint = 0x11u;
+pub static tag_index: uint = 0x11u;
 
-pub const tag_index_buckets: uint = 0x12u;
+pub static tag_index_buckets: uint = 0x12u;
 
-pub const tag_index_buckets_bucket: uint = 0x13u;
+pub static tag_index_buckets_bucket: uint = 0x13u;
 
-pub const tag_index_buckets_bucket_elt: uint = 0x14u;
+pub static tag_index_buckets_bucket_elt: uint = 0x14u;
 
-pub const tag_index_table: uint = 0x15u;
+pub static tag_index_table: uint = 0x15u;
 
-pub const tag_meta_item_name_value: uint = 0x18u;
+pub static tag_meta_item_name_value: uint = 0x18u;
 
-pub const tag_meta_item_name: uint = 0x19u;
+pub static tag_meta_item_name: uint = 0x19u;
 
-pub const tag_meta_item_value: uint = 0x20u;
+pub static tag_meta_item_value: uint = 0x20u;
 
-pub const tag_attributes: uint = 0x21u;
+pub static tag_attributes: uint = 0x21u;
 
-pub const tag_attribute: uint = 0x22u;
+pub static tag_attribute: uint = 0x22u;
 
-pub const tag_meta_item_word: uint = 0x23u;
+pub static tag_meta_item_word: uint = 0x23u;
 
-pub const tag_meta_item_list: uint = 0x24u;
+pub static tag_meta_item_list: uint = 0x24u;
 
 // The list of crates that this crate depends on
-pub const tag_crate_deps: uint = 0x25u;
+pub static tag_crate_deps: uint = 0x25u;
 
 // A single crate dependency
-pub const tag_crate_dep: uint = 0x26u;
+pub static tag_crate_dep: uint = 0x26u;
 
-pub const tag_crate_hash: uint = 0x28u;
+pub static tag_crate_hash: uint = 0x28u;
 
-pub const tag_parent_item: uint = 0x29u;
+pub static tag_parent_item: uint = 0x29u;
 
-pub const tag_crate_dep_name: uint = 0x2au;
-pub const tag_crate_dep_hash: uint = 0x2bu;
-pub const tag_crate_dep_vers: uint = 0x2cu;
+pub static tag_crate_dep_name: uint = 0x2au;
+pub static tag_crate_dep_hash: uint = 0x2bu;
+pub static tag_crate_dep_vers: uint = 0x2cu;
 
-pub const tag_mod_impl: uint = 0x30u;
+pub static tag_mod_impl: uint = 0x30u;
 
-pub const tag_item_trait_method: uint = 0x31u;
-pub const tag_impl_trait: uint = 0x32u;
+pub static tag_item_trait_method: uint = 0x31u;
+pub static tag_impl_trait: uint = 0x32u;
 
 // discriminator value for variants
-pub const tag_disr_val: uint = 0x34u;
+pub static tag_disr_val: uint = 0x34u;
 
 // used to encode ast_map::path and ast_map::path_elt
-pub const tag_path: uint = 0x40u;
-pub const tag_path_len: uint = 0x41u;
-pub const tag_path_elt_mod: uint = 0x42u;
-pub const tag_path_elt_name: uint = 0x43u;
-pub const tag_item_field: uint = 0x44u;
-pub const tag_struct_mut: uint = 0x45u;
-
-pub const tag_region_param: uint = 0x46u;
-pub const tag_mod_impl_trait: uint = 0x47u;
+pub static tag_path: uint = 0x40u;
+pub static tag_path_len: uint = 0x41u;
+pub static tag_path_elt_mod: uint = 0x42u;
+pub static tag_path_elt_name: uint = 0x43u;
+pub static tag_item_field: uint = 0x44u;
+pub static tag_struct_mut: uint = 0x45u;
+
+pub static tag_region_param: uint = 0x46u;
+pub static tag_mod_impl_trait: uint = 0x47u;
 /*
   trait items contain tag_item_trait_method elements,
   impl items contain tag_item_impl_method elements, and classes
@@ -97,16 +97,16 @@ impl items contain tag_item_impl_method elements, and classes
   both, tag_item_trait_method and tag_item_impl_method have to be two
   different tags.
  */
-pub const tag_item_impl_method: uint = 0x48u;
-pub const tag_item_dtor: uint = 0x49u;
-pub const tag_item_trait_method_self_ty: uint = 0x4b;
-pub const tag_item_trait_method_self_ty_region: uint = 0x4c;
+pub static tag_item_impl_method: uint = 0x48u;
+pub static tag_item_dtor: uint = 0x49u;
+pub static tag_item_trait_method_self_ty: uint = 0x4b;
+pub static tag_item_trait_method_self_ty_region: uint = 0x4c;
 
 // Reexports are found within module tags. Each reexport contains def_ids
 // and names.
-pub const tag_items_data_item_reexport: uint = 0x4d;
-pub const tag_items_data_item_reexport_def_id: uint = 0x4e;
-pub const tag_items_data_item_reexport_name: uint = 0x4f;
+pub static tag_items_data_item_reexport: uint = 0x4d;
+pub static tag_items_data_item_reexport_def_id: uint = 0x4e;
+pub static tag_items_data_item_reexport_name: uint = 0x4f;
 
 // used to encode crate_ctxt side tables
 pub enum astencode_tag { // Reserves 0x50 -- 0x6f
@@ -136,9 +136,9 @@ pub enum astencode_tag { // Reserves 0x50 -- 0x6f
     tag_table_capture_map = 0x64
 }
 
-pub const tag_item_trait_method_sort: uint = 0x70;
+pub static tag_item_trait_method_sort: uint = 0x70;
 
-pub const tag_item_impl_type_basename: uint = 0x71;
+pub static tag_item_impl_type_basename: uint = 0x71;
 
 // Language items are a top-level directory (for speed). Hierarchy:
 //
@@ -147,17 +147,17 @@ pub enum astencode_tag { // Reserves 0x50 -- 0x6f
 //   - tag_lang_items_item_id: u32
 //   - tag_lang_items_item_node_id: u32
 
-pub const tag_lang_items: uint = 0x72;
-pub const tag_lang_items_item: uint = 0x73;
-pub const tag_lang_items_item_id: uint = 0x74;
-pub const tag_lang_items_item_node_id: uint = 0x75;
+pub static tag_lang_items: uint = 0x72;
+pub static tag_lang_items_item: uint = 0x73;
+pub static tag_lang_items_item_id: uint = 0x74;
+pub static tag_lang_items_item_node_id: uint = 0x75;
 
-pub const tag_item_unnamed_field: uint = 0x76;
-pub const tag_items_data_item_struct_ctor: uint = 0x77;
-pub const tag_items_data_item_visibility: uint = 0x78;
+pub static tag_item_unnamed_field: uint = 0x76;
+pub static tag_items_data_item_struct_ctor: uint = 0x77;
+pub static tag_items_data_item_visibility: uint = 0x78;
 
-pub const tag_link_args: uint = 0x79;
-pub const tag_link_args_arg: uint = 0x7a;
+pub static tag_link_args: uint = 0x79;
+pub static tag_link_args_arg: uint = 0x7a;
 
 pub struct LinkMeta {
     name: @str,
index 6bb10a42f3e457fa5db5e579f4e89cbaff192d8d..ccc29fbbccb26b79e52a89fbb485a1c76a59ee94 100644 (file)
@@ -1313,7 +1313,7 @@ fn encode_hash(ebml_w: writer::Encoder, hash: &str) {
 }
 
 // NB: Increment this as you change the metadata encoding version.
-pub const metadata_encoding_version : &'static [u8] =
+pub static metadata_encoding_version : &'static [u8] =
     &[0x72, //'r' as u8,
       0x75, //'u' as u8,
       0x73, //'s' as u8,
index ef8857d444a527c87270d4e9f867ce3a1bb03307..75247e78acaa92e906a88c20449872810792a0dd 100644 (file)
@@ -58,7 +58,7 @@
 
 use core::hashmap::linear::LinearSet;
 
-pub const try_adding: &'static str = "Try adding a move";
+pub static try_adding: &'static str = "Try adding a move";
 
 pub type rval_map = HashMap<node_id, ()>;
 
index 0959e2eb0937ac54a5566e6b7ad7729d1c0fe6f1..e3a595a855211665e4eda3617b31dba3bceffc27 100644 (file)
@@ -653,9 +653,9 @@ struct Specials {
     no_ret_var: Variable
 }
 
-const ACC_READ: uint = 1u;
-const ACC_WRITE: uint = 2u;
-const ACC_USE: uint = 4u;
+static ACC_READ: uint = 1u;
+static ACC_WRITE: uint = 2u;
+static ACC_USE: uint = 4u;
 
 type LiveNodeMap = HashMap<node_id, LiveNode>;
 
index 0933cf6c8e5350e23d1413d549576f0cc0efe669..5e5cbc9f97191db1e2641d3e74fefc0a4f3a8632 100644 (file)
@@ -178,7 +178,7 @@ pub fn IndirectBr(cx: block, Addr: ValueRef, NumDests: uint) {
 // lot more efficient) than doing str::as_c_str("", ...) every time.
 pub fn noname() -> *libc::c_char {
     unsafe {
-        const cnull: uint = 0u;
+        static cnull: uint = 0u;
         return cast::reinterpret_cast(&ptr::addr_of(&cnull));
     }
 }
index c220bd23e20f0b84300ff6d048e7342eaad7ba4b..0b7d6f5c39bfe6bcf5cb90b89d9a918bf27d2df7 100644 (file)
@@ -76,8 +76,8 @@ pub fn new_namegen(intr: @ident_interner) -> namegen {
 //    0 is ignored by the GC, and is used for all non-GC'd pointers.
 //    1 is for opaque GC'd boxes.
 //    >= 2 are for specific types (e.g. resources).
-pub const default_addrspace: addrspace = 0;
-pub const gc_box_addrspace: addrspace = 1;
+pub static default_addrspace: addrspace = 0;
+pub static gc_box_addrspace: addrspace = 1;
 
 pub type addrspace_gen = @fn() -> addrspace;
 pub fn new_addrspace_gen() -> addrspace_gen {
@@ -615,7 +615,7 @@ pub fn mk_block(llbb: BasicBlockRef, parent: Option<block>, +kind: block_kind,
 }
 
 // First two args are retptr, env
-pub const first_real_arg: uint = 2u;
+pub static first_real_arg: uint = 2u;
 
 pub struct Result {
     bcx: block,
index 884bfd219ab7a5cd5184e2e35f93dd28b35ebdbb..ea34df54462b7eb6a607bc3732020e08b1f3f8ca 100644 (file)
@@ -179,7 +179,7 @@ pub fn const_expr(cx: @CrateContext, e: @ast::expr) -> ValueRef {
             llconst = C_struct(~[llconst, C_null(T_opaque_box_ptr(cx))])
         }
         Some(@ty::AutoAddEnv(ref r, ref s)) => {
-            cx.sess.span_bug(e.span, fmt!("unexpected const function: \
+            cx.sess.span_bug(e.span, fmt!("unexpected static function: \
                                            region %? sigil %?", *r, *s))
         }
         Some(@ty::AutoDerefRef(ref adj)) => {
index c575465ddf7846d72aef8d23523deb807cbde0b5..505c08fc8b8c11c4f25a342895ff50204c6b41c4 100644 (file)
 use syntax::parse::token::ident_interner;
 use syntax::{ast, codemap, ast_util, ast_map};
 
-const LLVMDebugVersion: int = (9 << 16);
-
-const DW_LANG_RUST: int = 0x9000;
-const DW_VIRTUALITY_none: int = 0;
-
-const CompileUnitTag: int = 17;
-const FileDescriptorTag: int = 41;
-const SubprogramTag: int = 46;
-const SubroutineTag: int = 21;
-const BasicTypeDescriptorTag: int = 36;
-const AutoVariableTag: int = 256;
-const ArgVariableTag: int = 257;
-const ReturnVariableTag: int = 258;
-const LexicalBlockTag: int = 11;
-const PointerTypeTag: int = 15;
-const StructureTypeTag: int = 19;
-const MemberTag: int = 13;
-const ArrayTypeTag: int = 1;
-const SubrangeTag: int = 33;
-
-const DW_ATE_boolean: int = 0x02;
-const DW_ATE_float: int = 0x04;
-const DW_ATE_signed: int = 0x05;
-const DW_ATE_signed_char: int = 0x06;
-const DW_ATE_unsigned: int = 0x07;
-const DW_ATE_unsigned_char: int = 0x08;
+static LLVMDebugVersion: int = (9 << 16);
+
+static DW_LANG_RUST: int = 0x9000;
+static DW_VIRTUALITY_none: int = 0;
+
+static CompileUnitTag: int = 17;
+static FileDescriptorTag: int = 41;
+static SubprogramTag: int = 46;
+static SubroutineTag: int = 21;
+static BasicTypeDescriptorTag: int = 36;
+static AutoVariableTag: int = 256;
+static ArgVariableTag: int = 257;
+static ReturnVariableTag: int = 258;
+static LexicalBlockTag: int = 11;
+static PointerTypeTag: int = 15;
+static StructureTypeTag: int = 19;
+static MemberTag: int = 13;
+static ArrayTypeTag: int = 1;
+static SubrangeTag: int = 33;
+
+static DW_ATE_boolean: int = 0x02;
+static DW_ATE_float: int = 0x04;
+static DW_ATE_signed: int = 0x05;
+static DW_ATE_signed_char: int = 0x06;
+static DW_ATE_unsigned: int = 0x07;
+static DW_ATE_unsigned_char: int = 0x08;
 
 fn llstr(s: &str) -> ValueRef {
     do str::as_c_str(s) |sbuf| {
index 77e10b2fbda64c5dc17e7068dbcd12f1e38ede3a..45cf790ccee20d3bc26d3da017446f49258d7d7f 100644 (file)
@@ -47,9 +47,9 @@
 use syntax::visit;
 
 pub type type_uses = uint; // Bitmask
-pub const use_repr: uint = 1u;   /* Dependency on size/alignment/mode and
-                                    take/drop glue */
-pub const use_tydesc: uint = 2u; /* Takes the tydesc, or compares */
+pub static use_repr: uint = 1u;   /* Dependency on size/alignment/mode and
+                                     take/drop glue */
+pub static use_tydesc: uint = 2u; /* Takes the tydesc, or compares */
 
 pub struct Context {
     ccx: @CrateContext,
index cbd2ad86b75fe100057e2214de4790443710c91c..de626675fa3f10b68389dcbb70d0fd801c18e682 100644 (file)
@@ -1801,43 +1801,43 @@ fn to_str(&self) -> ~str {
 }
 
 /// Constant for a type containing nothing of interest.
-const TC_NONE: TypeContents =             TypeContents{bits:0b0000_00000000};
+static TC_NONE: TypeContents =             TypeContents{bits:0b0000_00000000};
 
 /// Contains a borrowed value with a lifetime other than static
-const TC_BORROWED_POINTER: TypeContents = TypeContents{bits:0b0000_00000001};
+static TC_BORROWED_POINTER: TypeContents = TypeContents{bits:0b0000_00000001};
 
 /// Contains an owned pointer (~T) but not slice of some kind
-const TC_OWNED_POINTER: TypeContents =    TypeContents{bits:0b000000000010};
+static TC_OWNED_POINTER: TypeContents =    TypeContents{bits:0b000000000010};
 
 /// Contains an owned vector ~[] or owned string ~str
-const TC_OWNED_VEC: TypeContents =        TypeContents{bits:0b000000000100};
+static TC_OWNED_VEC: TypeContents =        TypeContents{bits:0b000000000100};
 
 /// Contains a ~fn() or a ~Trait, which is non-copyable.
-const TC_OWNED_CLOSURE: TypeContents =    TypeContents{bits:0b000000001000};
+static TC_OWNED_CLOSURE: TypeContents =    TypeContents{bits:0b000000001000};
 
 /// Type with a destructor
-const TC_DTOR: TypeContents =             TypeContents{bits:0b000000010000};
+static TC_DTOR: TypeContents =             TypeContents{bits:0b000000010000};
 
 /// Contains a managed value
-const TC_MANAGED: TypeContents =          TypeContents{bits:0b000000100000};
+static TC_MANAGED: TypeContents =          TypeContents{bits:0b000000100000};
 
 /// &mut with any region
-const TC_BORROWED_MUT: TypeContents =     TypeContents{bits:0b000001000000};
+static TC_BORROWED_MUT: TypeContents =     TypeContents{bits:0b000001000000};
 
 /// Mutable content, whether owned or by ref
-const TC_MUTABLE: TypeContents =          TypeContents{bits:0b000010000000};
+static TC_MUTABLE: TypeContents =          TypeContents{bits:0b000010000000};
 
 /// Mutable content, whether owned or by ref
-const TC_ONCE_CLOSURE: TypeContents =     TypeContents{bits:0b000100000000};
+static TC_ONCE_CLOSURE: TypeContents =     TypeContents{bits:0b000100000000};
 
 /// Something we estimate to be "big"
-const TC_BIG: TypeContents =              TypeContents{bits:0b001000000000};
+static TC_BIG: TypeContents =              TypeContents{bits:0b001000000000};
 
 /// An enum with no variants.
-const TC_EMPTY_ENUM: TypeContents =       TypeContents{bits:0b010000000000};
+static TC_EMPTY_ENUM: TypeContents =       TypeContents{bits:0b010000000000};
 
 /// All possible contents.
-const TC_ALL: TypeContents =              TypeContents{bits:0b011111111111};
+static TC_ALL: TypeContents =              TypeContents{bits:0b011111111111};
 
 pub fn type_is_copyable(cx: ctxt, t: ty::t) -> bool {
     type_contents(cx, t).is_copy(cx)
@@ -4076,21 +4076,21 @@ fn struct_item_fields(cx:ctxt,
 }
 
 pub fn is_binopable(_cx: ctxt, ty: t, op: ast::binop) -> bool {
-    const tycat_other: int = 0;
-    const tycat_bool: int = 1;
-    const tycat_int: int = 2;
-    const tycat_float: int = 3;
-    const tycat_struct: int = 4;
-    const tycat_bot: int = 5;
-
-    const opcat_add: int = 0;
-    const opcat_sub: int = 1;
-    const opcat_mult: int = 2;
-    const opcat_shift: int = 3;
-    const opcat_rel: int = 4;
-    const opcat_eq: int = 5;
-    const opcat_bit: int = 6;
-    const opcat_logic: int = 7;
+    static tycat_other: int = 0;
+    static tycat_bool: int = 1;
+    static tycat_int: int = 2;
+    static tycat_float: int = 3;
+    static tycat_struct: int = 4;
+    static tycat_bot: int = 5;
+
+    static opcat_add: int = 0;
+    static opcat_sub: int = 1;
+    static opcat_mult: int = 2;
+    static opcat_shift: int = 3;
+    static opcat_rel: int = 4;
+    static opcat_eq: int = 5;
+    static opcat_bit: int = 6;
+    static opcat_logic: int = 7;
 
     fn opcat(op: ast::binop) -> int {
         match op {
@@ -4126,8 +4126,8 @@ fn tycat(ty: t) -> int {
         }
     }
 
-    const t: bool = true;
-    const f: bool = false;
+    static t: bool = true;
+    static f: bool = false;
 
     let tbl = ~[
     /*.          add,     shift,   bit
index e259fdaf400e4e4607b1ffb5bf56c7e391bf1076..c288151308fe4624af6f5dd6a2f7b2a95d5c6b87 100644 (file)
@@ -202,8 +202,8 @@ pub fn ast_path_to_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
     ty_param_substs_and_ty { substs: substs, ty: ty }
 }
 
-pub const NO_REGIONS: uint = 1;
-pub const NO_TPS: uint = 2;
+pub static NO_REGIONS: uint = 1;
+pub static NO_TPS: uint = 2;
 
 // Parses the programmer's textual representation of a type into our
 // internal notion of a type. `getter` is a function that returns the type
index 1d9594d930c6d91ef2346248937a22735ec92093..038dc524bec07e37a7ddc119d15697e30b957ac8 100644 (file)
 
 use core::vec;
 
-pub const resolve_nested_tvar: uint = 0b0000000001;
-pub const resolve_rvar: uint        = 0b0000000010;
-pub const resolve_ivar: uint        = 0b0000000100;
-pub const resolve_fvar: uint        = 0b0000001000;
-pub const resolve_fnvar: uint       = 0b0000010000;
-pub const resolve_all: uint         = 0b0000011111;
-pub const force_tvar: uint          = 0b0000100000;
-pub const force_rvar: uint          = 0b0001000000;
-pub const force_ivar: uint          = 0b0010000000;
-pub const force_fvar: uint          = 0b0100000000;
-pub const force_fnvar: uint         = 0b1000000000;
-pub const force_all: uint           = 0b1111100000;
-
-pub const not_regions: uint         = !(force_rvar | resolve_rvar);
-
-pub const try_resolve_tvar_shallow: uint = 0;
-pub const resolve_and_force_all_but_regions: uint =
+pub static resolve_nested_tvar: uint = 0b0000000001;
+pub static resolve_rvar: uint        = 0b0000000010;
+pub static resolve_ivar: uint        = 0b0000000100;
+pub static resolve_fvar: uint        = 0b0000001000;
+pub static resolve_fnvar: uint       = 0b0000010000;
+pub static resolve_all: uint         = 0b0000011111;
+pub static force_tvar: uint          = 0b0000100000;
+pub static force_rvar: uint          = 0b0001000000;
+pub static force_ivar: uint          = 0b0010000000;
+pub static force_fvar: uint          = 0b0100000000;
+pub static force_fnvar: uint         = 0b1000000000;
+pub static force_all: uint           = 0b1111100000;
+
+pub static not_regions: uint         = !(force_rvar | resolve_rvar);
+
+pub static try_resolve_tvar_shallow: uint = 0;
+pub static resolve_and_force_all_but_regions: uint =
     (resolve_all | force_all) & not_regions;
 
 pub struct ResolveState {
index 867bcc30fa4ea30ab0a6441ee40374a7edfd5654..6a4def65fe744a2a30eca6d73501b6eb6b616e44 100644 (file)
@@ -47,7 +47,7 @@ struct RH {
     sub: &[RH]
 }
 
-const EMPTY_SOURCE_STR: &str = "/* Hello, world! */";
+static EMPTY_SOURCE_STR: &str = "/* Hello, world! */";
 
 fn setup_env(test_name: &str, source_string: &str) -> Env {
     let messages = @DVec();
index ad57af8942d353db7602223bc9627263837e93c3..c5fb8f289f65e81f4a1b7a392a57e0bb4f967e9a 100644 (file)
@@ -24,7 +24,7 @@
 use core::prelude::*;
 
 /// The base price of a muffin on a non-holiday
-const price_of_a_muffin: float = 70f;
+static price_of_a_muffin: float = 70f;
 
 struct WaitPerson {
     hair_color: ~str
index 281c318eb152cc8b5a0aeb931d31a1c930b8a8ef..957b94d18f5321a56eb82d241f3bee46ab6e38bd 100644 (file)
@@ -127,8 +127,7 @@ fn extract(desc: Option<~str>) -> Option<~str> {
 }
 
 fn parse_desc(desc: ~str) -> Option<~str> {
-
-    const max_brief_len: uint = 120u;
+    static max_brief_len: uint = 120u;
 
     match first_sentence(copy desc) {
       Some(first_sentence) => {
index 5e5c843da26da610839984beb55cd40540b2999a..942dd3e01cbd550e1231364dfbf3caacb170e5d3 100644 (file)
@@ -184,7 +184,7 @@ fn constdoc_from_const(itemdoc: doc::ItemDoc) -> doc::ConstDoc {
 
 #[test]
 fn should_extract_const_name_and_id() {
-    let doc = test::mk_doc(~"const a: int = 0;");
+    let doc = test::mk_doc(~"static a: int = 0;");
     fail_unless!(doc.cratemod().consts()[0].id() != 0);
     fail_unless!(doc.cratemod().consts()[0].name() == ~"a");
 }
index e9d9732d51fd33a961357da61bc35f615f135a4d..2cd9ef3671d6ec958c57177bd6dcb1b1792fe4cd 100644 (file)
@@ -378,7 +378,7 @@ fn default_fold_should_produce_same_doc() {
 
 #[test]
 fn default_fold_should_produce_same_consts() {
-    let source = ~"const a: int = 0;";
+    let source = ~"static a: int = 0;";
     let ast = parse::from_str(source);
     let doc = extract::extract(ast, ~"");
     let fld = default_seq_fold(());
index 227eb25aa81fefe2e07efea550e0d21d1baaa7d1..73f3aa53c250debd7d3018f184af3973a25bee53 100644 (file)
@@ -594,7 +594,7 @@ fn write_const(
 
 #[test]
 fn should_write_const_header() {
-    let markdown = test::render(~"const a: bool = true;");
+    let markdown = test::render(~"static a: bool = true;");
     fail_unless!(str::contains(markdown, ~"## Const `a`\n\n"));
 }
 
@@ -602,7 +602,7 @@ fn should_write_const_header() {
 fn should_write_const_description() {
     let markdown = test::render(
         ~"#[doc = \"b\"]\
-         const a: bool = true;");
+         static a: bool = true;");
     fail_unless!(str::contains(markdown, ~"\n\nb\n\n"));
 }
 
index 96727f6386d237d5ed2311ee754497d09922a789..5919f1b0c2fbead9f101a3946c9e5807abd29ff7 100644 (file)
@@ -45,7 +45,7 @@ fn test() {
         ~"mod imod { } \
          extern mod inmod {
          } \
-         const iconst: int = 0; \
+         static iconst: int = 0; \
          fn ifn() { } \
          enum ienum { ivar } \
          trait itrait { fn a(); } \
index 638274d0bb8ee62c8944530065045bc42be97dee..1472f6777b48fe9bdbb5aa3bc1ae279d54171e44 100644 (file)
@@ -121,7 +121,7 @@ fn fold_const(
 
 #[test]
 fn should_add_const_types() {
-    let doc = test::mk_doc(~"const a: bool = true;");
+    let doc = test::mk_doc(~"static a: bool = true;");
     fail_unless!(doc.cratemod().consts()[0].sig == Some(~"bool"));
 }
 
index 0572cf771dbed4f26a8120e95ea97026dad6e694..8e5d7e95ae17ab6893457b5bbfb7ca5dfa47ff69 100644 (file)
@@ -139,7 +139,7 @@ fn add_pkg_module(ctx: @mut ReadyCtx, m: ast::_mod) -> ast::_mod {
     let item = quote_item! (
         mod __pkg {
             extern mod rustpkg (vers="0.6");
-            const listeners : &[rustpkg::Listener] = $listeners;
+            static listeners : &[rustpkg::Listener] = $listeners;
             #[main]
             fn main() {
                 rustpkg::run(listeners);
index d76438dd89bc1e4d2ed392bd493e4d41838d64f9..a26132d92ca0158f08efb91512f3af59b9d8d017 100644 (file)
@@ -68,7 +68,7 @@ unsafe fn rust_call_tydesc_glue(root: *u8,
 
 // This probably belongs somewhere else. Needs to be kept in sync with
 // changes to glue...
-const tydesc_drop_glue_index: size_t = 3 as size_t;
+static tydesc_drop_glue_index: size_t = 3 as size_t;
 
 // The way arena uses arrays is really deeply awful. The arrays are
 // allocated, and have capacities reserved, but the fill for the array
index 309925e7cf9b48e2462770baf21bb620059dd600..564afea9f08358922e8b23f5fc1ed3d9df73503a 100644 (file)
@@ -44,14 +44,14 @@ pub mod BigDigit {
     #[cfg(target_arch = "x86")]
     #[cfg(target_arch = "arm")]
     #[cfg(target_arch = "mips")]
-    pub const bits: uint = 16;
+    pub static bits: uint = 16;
 
     #[cfg(target_arch = "x86_64")]
-    pub const bits: uint = 32;
+    pub static bits: uint = 32;
 
-    pub const base: uint = 1 << bits;
-    priv const hi_mask: uint = (-1 as uint) << bits;
-    priv const lo_mask: uint = (-1 as uint) >> bits;
+    pub static base: uint = 1 << bits;
+    priv static hi_mask: uint = (-1 as uint) << bits;
+    priv static lo_mask: uint = (-1 as uint) >> bits;
 
     priv fn get_hi(n: uint) -> BigDigit { (n >> bits) as BigDigit }
     priv fn get_lo(n: uint) -> BigDigit { (n & lo_mask) as BigDigit }
@@ -1046,9 +1046,9 @@ fn check(v: ~[BigDigit], u: uint) {
         fail_unless!(BigUint::new(~[0, 0, -1]).to_uint() == uint::max_value);
     }
 
-    const sum_triples: &'static [(&'static [BigDigit],
-                                 &'static [BigDigit],
-                                 &'static [BigDigit])] = &[
+    static sum_triples: &'static [(&'static [BigDigit],
+                                   &'static [BigDigit],
+                                   &'static [BigDigit])] = &[
         (&[],          &[],       &[]),
         (&[],          &[ 1],     &[ 1]),
         (&[ 1],        &[ 1],     &[ 2]),
@@ -1086,9 +1086,9 @@ fn test_sub() {
         }
     }
 
-    const mul_triples: &'static [(&'static [BigDigit],
-                                 &'static [BigDigit],
-                                 &'static [BigDigit])] = &[
+    static mul_triples: &'static [(&'static [BigDigit],
+                                   &'static [BigDigit],
+                                   &'static [BigDigit])] = &[
         (&[],               &[],               &[]),
         (&[],               &[ 1],             &[]),
         (&[ 2],             &[],               &[]),
@@ -1112,10 +1112,10 @@ fn test_sub() {
         (&[ 0,  0,  1],     &[ 0,  0,  0,  1], &[0, 0,  0,  0,  0,  1])
     ];
 
-    const divmod_quadruples: &'static [(&'static [BigDigit],
-                                       &'static [BigDigit],
-                                       &'static [BigDigit],
-                                       &'static [BigDigit])]
+    static divmod_quadruples: &'static [(&'static [BigDigit],
+                                         &'static [BigDigit],
+                                         &'static [BigDigit],
+                                         &'static [BigDigit])]
         = &[
             (&[ 1],        &[ 2], &[],               &[1]),
             (&[ 1,  1],    &[ 2], &[-1/2+1],         &[1]),
@@ -1400,9 +1400,9 @@ fn check(b: BigInt, u: uint) {
         ).to_uint() == 0);
     }
 
-    const sum_triples: &'static [(&'static [BigDigit],
-                                 &'static [BigDigit],
-                                 &'static [BigDigit])] = &[
+    static sum_triples: &'static [(&'static [BigDigit],
+                                   &'static [BigDigit],
+                                   &'static [BigDigit])] = &[
         (&[],          &[],       &[]),
         (&[],          &[ 1],     &[ 1]),
         (&[ 1],        &[ 1],     &[ 2]),
@@ -1452,9 +1452,9 @@ fn test_sub() {
         }
     }
 
-    const mul_triples: &'static [(&'static [BigDigit],
-                                 &'static [BigDigit],
-                                 &'static [BigDigit])] = &[
+    static mul_triples: &'static [(&'static [BigDigit],
+                                   &'static [BigDigit],
+                                   &'static [BigDigit])] = &[
         (&[],               &[],               &[]),
         (&[],               &[ 1],             &[]),
         (&[ 2],             &[],               &[]),
@@ -1478,10 +1478,10 @@ fn test_sub() {
         (&[ 0,  0,  1],     &[ 0,  0,  0,  1], &[0, 0,  0,  0,  0,  1])
     ];
 
-    const divmod_quadruples: &'static [(&'static [BigDigit],
-                                       &'static [BigDigit],
-                                       &'static [BigDigit],
-                                       &'static [BigDigit])]
+    static divmod_quadruples: &'static [(&'static [BigDigit],
+                                         &'static [BigDigit],
+                                         &'static [BigDigit],
+                                         &'static [BigDigit])]
         = &[
             (&[ 1],        &[ 2], &[],               &[1]),
             (&[ 1,  1],    &[ 2], &[-1/2+1],         &[1]),
index 270a2c1fc1b316c0c8b8b9e5ca854867b714a90e..3acc95a3aad62d59d112da004552f5332649a27b 100644 (file)
@@ -877,7 +877,7 @@ mod tests {
     use core::vec;
     use core::rand;
 
-    const bench_bits : uint = 1 << 14;
+    static bench_bits : uint = 1 << 14;
 
     #[test]
     pub fn test_to_str() {
index 6fd77de034262372d37969c02d94f358c3ed300f..93a2f4e2acc74051e282122fc2897b93e125e0c4 100644 (file)
@@ -14,7 +14,7 @@
 use core::f64;
 use core::float;
 
-pub const FUZZY_EPSILON: float = 1.0e-6;
+pub static FUZZY_EPSILON: float = 1.0e-6;
 
 pub trait FuzzyEq<Eps> {
     fn fuzzy_eq(&self, other: &Self) -> bool;
index 4f61321b4e777d749e7a455d5c7f5ee740d3a67c..e6fcbdc84c8771cc30697fe6e09437d0feb06d4d 100644 (file)
@@ -14,7 +14,7 @@
 use core::prelude::*;
 use core::vec;
 
-const initial_capacity: uint = 32u; // 2^5
+static initial_capacity: uint = 32u; // 2^5
 
 pub struct Deque<T> {
     priv nelts: uint,
index 437ab561f954576ab610c76c2b6b63a335ffbfb2..92898af2993deb29dbb6d764a92b1f9a8c53f125 100644 (file)
@@ -545,7 +545,7 @@ fn wr_str(&self, s: &str) {
 
     // Set to true to generate more debugging in EBML code.
     // Totally lame approach.
-    const debug: bool = false;
+    static debug: bool = false;
 
     priv impl Encoder {
         // used internally to emit things like the vector length and so on
index 9855e803ccbccdf18b9d6613ffa67713c05bcc51..01d672c9b26f5c3d18cdd1b469e8e43b4ce2b9a0 100644 (file)
@@ -254,7 +254,7 @@ pub trait ByteChan {
     fn send(&self, val: ~[u8]);
 }
 
-const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
+static CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
 
 impl<T,U:Unflattener<T>,P:BytePort> GenericPort<T> for FlatPort<T, U, P> {
     fn recv(&self) -> T {
@@ -921,7 +921,7 @@ fn test_try_recv_none2_pipe() {
         }
 
         fn test_try_recv_none3<P:BytePort>(loader: PortLoader<P>) {
-            const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
+            static CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
             // The control word is followed by garbage
             let bytes = CONTINUE.to_vec() + ~[0];
             let port = loader(bytes);
@@ -940,7 +940,7 @@ fn test_try_recv_none3_pipe() {
 
         fn test_try_recv_none4<P:BytePort>(+loader: PortLoader<P>) {
             fail_unless!(do task::try || {
-                const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
+                static CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
                 // The control word is followed by a valid length,
                 // then undeserializable garbage
                 let len_bytes = do io::u64_to_be_bytes(
index 0b688f0c67861bb3a282616c177fd1492cfc5582..02c610e4854d8fd79dafed54fd5d91b2cb51d5bc 100644 (file)
@@ -51,7 +51,7 @@ pub mod chained {
     use core::uint;
     use core::vec;
 
-    const initial_capacity: uint = 32u; // 2^5
+    static initial_capacity: uint = 32u; // 2^5
 
     struct Entry<K, V> {
         hash: uint,
index 17ae48e03b93f1ff8c331e0ace3cad2656d7695a..6f69ac4e1bd699ca39dc8980613b1acab7190930 100644 (file)
  * The maximum number of tasks this module will spawn for a single
  * operation.
  */
-const max_tasks : uint = 32u;
+static max_tasks : uint = 32u;
 
 /// The minimum number of elements each task will process.
-const min_granularity : uint = 1024u;
+static min_granularity : uint = 1024u;
 
 /**
  * An internal helper to map a function over a large vector and
index c9ad762880ca562141ef8310256aad0550996124..51cf08c8ca1fe0c3ee5e75ad91d906dac929da21 100644 (file)
@@ -636,14 +636,14 @@ pub enum Node {
      *
      * This is not a strict value
      */
-    pub const hint_max_leaf_char_len: uint = 256u;
+    pub static hint_max_leaf_char_len: uint = 256u;
 
     /**
      * The maximal height that _should_ be permitted in a tree.
      *
      * This is not a strict value
      */
-    pub const hint_max_node_height:   uint = 16u;
+    pub static hint_max_node_height:   uint = 16u;
 
     /**
      * Adopt a string as a node.
index 077ab191e69e3708b00cf053791f84cc14e0a363..64399defd54f7a9e1a3fdc8bc20302d8755eef68 100644 (file)
@@ -53,13 +53,13 @@ trait Sha1 {
 }
 
 // Some unexported constants
-const digest_buf_len: uint = 5u;
-const msg_block_len: uint = 64u;
-const work_buf_len: uint = 80u;
-const k0: u32 = 0x5A827999u32;
-const k1: u32 = 0x6ED9EBA1u32;
-const k2: u32 = 0x8F1BBCDCu32;
-const k3: u32 = 0xCA62C1D6u32;
+static digest_buf_len: uint = 5u;
+static msg_block_len: uint = 64u;
+static work_buf_len: uint = 80u;
+static k0: u32 = 0x5A827999u32;
+static k1: u32 = 0x6ED9EBA1u32;
+static k2: u32 = 0x8F1BBCDCu32;
+static k3: u32 = 0xCA62C1D6u32;
 
 
 /// Construct a `sha` object
index 8ab2c40116ad7b1b0d108c8e55ea465355a24022..33f585d32fc9ffc2942f76dead8d4053bcbcc61c 100644 (file)
@@ -177,9 +177,9 @@ impl<T:Copy + Ord + Eq> Sort for &'self mut [T] {
     fn qsort(self) { quick_sort3(self); }
 }
 
-const MIN_MERGE: uint = 64;
-const MIN_GALLOP: uint = 7;
-const INITIAL_TMP_STORAGE: uint = 128;
+static MIN_MERGE: uint = 64;
+static MIN_GALLOP: uint = 7;
+static INITIAL_TMP_STORAGE: uint = 128;
 
 pub fn tim_sort<T:Copy + Ord>(array: &mut [T]) {
     let size = array.len();
index 2a8c8b3b06bbdf676ce3a06418bd7b4c093377f7..a6c8884e05d4dbb8c73cb4ff138027dd970b3ed4 100644 (file)
 
 // FIXME (#2807): Windows support.
 
-pub const color_black: u8 = 0u8;
-pub const color_red: u8 = 1u8;
-pub const color_green: u8 = 2u8;
-pub const color_yellow: u8 = 3u8;
-pub const color_blue: u8 = 4u8;
-pub const color_magenta: u8 = 5u8;
-pub const color_cyan: u8 = 6u8;
-pub const color_light_gray: u8 = 7u8;
-pub const color_light_grey: u8 = 7u8;
-pub const color_dark_gray: u8 = 8u8;
-pub const color_dark_grey: u8 = 8u8;
-pub const color_bright_red: u8 = 9u8;
-pub const color_bright_green: u8 = 10u8;
-pub const color_bright_yellow: u8 = 11u8;
-pub const color_bright_blue: u8 = 12u8;
-pub const color_bright_magenta: u8 = 13u8;
-pub const color_bright_cyan: u8 = 14u8;
-pub const color_bright_white: u8 = 15u8;
+pub static color_black: u8 = 0u8;
+pub static color_red: u8 = 1u8;
+pub static color_green: u8 = 2u8;
+pub static color_yellow: u8 = 3u8;
+pub static color_blue: u8 = 4u8;
+pub static color_magenta: u8 = 5u8;
+pub static color_cyan: u8 = 6u8;
+pub static color_light_gray: u8 = 7u8;
+pub static color_light_grey: u8 = 7u8;
+pub static color_dark_gray: u8 = 8u8;
+pub static color_dark_grey: u8 = 8u8;
+pub static color_bright_red: u8 = 9u8;
+pub static color_bright_green: u8 = 10u8;
+pub static color_bright_yellow: u8 = 11u8;
+pub static color_bright_blue: u8 = 12u8;
+pub static color_bright_magenta: u8 = 13u8;
+pub static color_bright_cyan: u8 = 14u8;
+pub static color_bright_white: u8 = 15u8;
 
 pub fn esc(writer: @io::Writer) { writer.write(~[0x1bu8, '[' as u8]); }
 
index 7531992ae848546883eee3966f6c69f6d9a2a2b4..d039e8eef5aa6bb9724a8fda9647ad9e69e047cb 100644 (file)
@@ -477,10 +477,10 @@ fn run_tests(opts: &TestOpts,
 
 // Windows tends to dislike being overloaded with threads.
 #[cfg(windows)]
-const sched_overcommit : uint = 1;
+static sched_overcommit : uint = 1;
 
 #[cfg(unix)]
-const sched_overcommit : uint = 4u;
+static sched_overcommit : uint = 4u;
 
 fn get_concurrency() -> uint {
     unsafe {
index b46d58f891b6cbf51f9c99e2d71b5c6fde8a3445..ce153c1ac24714bedea137a3a9d86ef0d4b54593 100644 (file)
@@ -17,7 +17,7 @@
 use core::result::{Result, Ok, Err};
 use core::str;
 
-const NSEC_PER_SEC: i32 = 1_000_000_000_i32;
+static NSEC_PER_SEC: i32 = 1_000_000_000_i32;
 
 pub mod rustrt {
     use super::Tm;
@@ -900,8 +900,8 @@ mod tests {
     use core::vec;
 
     pub fn test_get_time() {
-        const some_recent_date: i64 = 1325376000i64; // 2012-01-01T00:00:00Z
-        const some_future_date: i64 = 1577836800i64; // 2020-01-01T00:00:00Z
+        static some_recent_date: i64 = 1325376000i64; // 2012-01-01T00:00:00Z
+        static some_future_date: i64 = 1577836800i64; // 2020-01-01T00:00:00Z
 
         let tv1 = get_time();
         debug!("tv1=%? sec + %? nsec", tv1.sec as uint, tv1.nsec as uint);
index f22bdaff3a0fcd1070f11aa703aadbdcf25c1d01..4fdd4e286da1a08d5a26956f47a2e06f97a7e54a 100644 (file)
@@ -15,147 +15,147 @@ pub mod icu {
     pub type UProperty = int;
     pub type UChar32 = char;
 
-    pub const TRUE : u8 = 1u8;
-    pub const FALSE : u8 = 1u8;
-
-    pub const UCHAR_ALPHABETIC : UProperty = 0;
-    pub const UCHAR_BINARY_START : UProperty = 0; // = UCHAR_ALPHABETIC
-    pub const UCHAR_ASCII_HEX_DIGIT : UProperty = 1;
-    pub const UCHAR_BIDI_CONTROL : UProperty = 2;
-
-    pub const UCHAR_BIDI_MIRRORED : UProperty = 3;
-    pub const UCHAR_DASH : UProperty = 4;
-    pub const UCHAR_DEFAULT_IGNORABLE_CODE_POINT : UProperty = 5;
-    pub const UCHAR_DEPRECATED : UProperty = 6;
-
-    pub const UCHAR_DIACRITIC : UProperty = 7;
-    pub const UCHAR_EXTENDER : UProperty = 8;
-    pub const UCHAR_FULL_COMPOSITION_EXCLUSION : UProperty = 9;
-    pub const UCHAR_GRAPHEME_BASE : UProperty = 10;
-
-    pub const UCHAR_GRAPHEME_EXTEND : UProperty = 11;
-    pub const UCHAR_GRAPHEME_LINK : UProperty = 12;
-    pub const UCHAR_HEX_DIGIT : UProperty = 13;
-    pub const UCHAR_HYPHEN : UProperty = 14;
-
-    pub const UCHAR_ID_CONTINUE : UProperty = 15;
-    pub const UCHAR_ID_START : UProperty = 16;
-    pub const UCHAR_IDEOGRAPHIC : UProperty = 17;
-    pub const UCHAR_IDS_BINARY_OPERATOR : UProperty = 18;
-
-    pub const UCHAR_IDS_TRINARY_OPERATOR : UProperty = 19;
-    pub const UCHAR_JOIN_CONTROL : UProperty = 20;
-    pub const UCHAR_LOGICAL_ORDER_EXCEPTION : UProperty = 21;
-    pub const UCHAR_LOWERCASE : UProperty = 22;
-
-    pub const UCHAR_MATH : UProperty = 23;
-    pub const UCHAR_NONCHARACTER_CODE_POINT : UProperty = 24;
-    pub const UCHAR_QUOTATION_MARK : UProperty = 25;
-    pub const UCHAR_RADICAL : UProperty = 26;
-
-    pub const UCHAR_SOFT_DOTTED : UProperty = 27;
-    pub const UCHAR_TERMINAL_PUNCTUATION : UProperty = 28;
-    pub const UCHAR_UNIFIED_IDEOGRAPH : UProperty = 29;
-    pub const UCHAR_UPPERCASE : UProperty = 30;
-
-    pub const UCHAR_WHITE_SPACE : UProperty = 31;
-    pub const UCHAR_XID_CONTINUE : UProperty = 32;
-    pub const UCHAR_XID_START : UProperty = 33;
-    pub const UCHAR_CASE_SENSITIVE : UProperty = 34;
-
-    pub const UCHAR_S_TERM : UProperty = 35;
-    pub const UCHAR_VARIATION_SELECTOR : UProperty = 36;
-    pub const UCHAR_NFD_INERT : UProperty = 37;
-    pub const UCHAR_NFKD_INERT : UProperty = 38;
-
-    pub const UCHAR_NFC_INERT : UProperty = 39;
-    pub const UCHAR_NFKC_INERT : UProperty = 40;
-    pub const UCHAR_SEGMENT_STARTER : UProperty = 41;
-    pub const UCHAR_PATTERN_SYNTAX : UProperty = 42;
-
-    pub const UCHAR_PATTERN_WHITE_SPACE : UProperty = 43;
-    pub const UCHAR_POSIX_ALNUM : UProperty = 44;
-    pub const UCHAR_POSIX_BLANK : UProperty = 45;
-    pub const UCHAR_POSIX_GRAPH : UProperty = 46;
-
-    pub const UCHAR_POSIX_PRINT : UProperty = 47;
-    pub const UCHAR_POSIX_XDIGIT : UProperty = 48;
-    pub const UCHAR_CASED : UProperty = 49;
-    pub const UCHAR_CASE_IGNORABLE : UProperty = 50;
-
-    pub const UCHAR_CHANGES_WHEN_LOWERCASED : UProperty = 51;
-    pub const UCHAR_CHANGES_WHEN_UPPERCASED : UProperty = 52;
-    pub const UCHAR_CHANGES_WHEN_TITLECASED : UProperty = 53;
-    pub const UCHAR_CHANGES_WHEN_CASEFOLDED : UProperty = 54;
-
-    pub const UCHAR_CHANGES_WHEN_CASEMAPPED : UProperty = 55;
-    pub const UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED : UProperty = 56;
-    pub const UCHAR_BINARY_LIMIT : UProperty = 57;
-    pub const UCHAR_BIDI_CLASS : UProperty = 0x1000;
-
-    pub const UCHAR_INT_START : UProperty = 0x1000; // UCHAR_BIDI_CLASS
-    pub const UCHAR_BLOCK : UProperty = 0x1001;
-    pub const UCHAR_CANONICAL_COMBINING_CLASS : UProperty = 0x1002;
-    pub const UCHAR_DECOMPOSITION_TYPE : UProperty = 0x1003;
-
-    pub const UCHAR_EAST_ASIAN_WIDTH : UProperty = 0x1004;
-    pub const UCHAR_GENERAL_CATEGORY : UProperty = 0x1005;
-    pub const UCHAR_JOINING_GROUP : UProperty = 0x1006;
-    pub const UCHAR_JOINING_TYPE : UProperty = 0x1007;
-
-    pub const UCHAR_LINE_BREAK : UProperty = 0x1008;
-    pub const UCHAR_NUMERIC_TYPE : UProperty = 0x1009;
-    pub const UCHAR_SCRIPT : UProperty = 0x100A;
-    pub const UCHAR_HANGUL_SYLLABLE_TYPE : UProperty = 0x100B;
-
-    pub const UCHAR_NFD_QUICK_CHECK : UProperty = 0x100C;
-    pub const UCHAR_NFKD_QUICK_CHECK : UProperty = 0x100D;
-    pub const UCHAR_NFC_QUICK_CHECK : UProperty = 0x100E;
-    pub const UCHAR_NFKC_QUICK_CHECK : UProperty = 0x100F;
-
-    pub const UCHAR_LEAD_CANONICAL_COMBINING_CLASS : UProperty = 0x1010;
-    pub const UCHAR_TRAIL_CANONICAL_COMBINING_CLASS : UProperty = 0x1011;
-    pub const UCHAR_GRAPHEME_CLUSTER_BREAK : UProperty = 0x1012;
-    pub const UCHAR_SENTENCE_BREAK : UProperty = 0x1013;
-
-    pub const UCHAR_WORD_BREAK : UProperty = 0x1014;
-    pub const UCHAR_INT_LIMIT : UProperty = 0x1015;
-
-    pub const UCHAR_GENERAL_CATEGORY_MASK : UProperty = 0x2000;
-    pub const UCHAR_MASK_START : UProperty = 0x2000;
+    pub static TRUE : u8 = 1u8;
+    pub static FALSE : u8 = 1u8;
+
+    pub static UCHAR_ALPHABETIC : UProperty = 0;
+    pub static UCHAR_BINARY_START : UProperty = 0; // = UCHAR_ALPHABETIC
+    pub static UCHAR_ASCII_HEX_DIGIT : UProperty = 1;
+    pub static UCHAR_BIDI_CONTROL : UProperty = 2;
+
+    pub static UCHAR_BIDI_MIRRORED : UProperty = 3;
+    pub static UCHAR_DASH : UProperty = 4;
+    pub static UCHAR_DEFAULT_IGNORABLE_CODE_POINT : UProperty = 5;
+    pub static UCHAR_DEPRECATED : UProperty = 6;
+
+    pub static UCHAR_DIACRITIC : UProperty = 7;
+    pub static UCHAR_EXTENDER : UProperty = 8;
+    pub static UCHAR_FULL_COMPOSITION_EXCLUSION : UProperty = 9;
+    pub static UCHAR_GRAPHEME_BASE : UProperty = 10;
+
+    pub static UCHAR_GRAPHEME_EXTEND : UProperty = 11;
+    pub static UCHAR_GRAPHEME_LINK : UProperty = 12;
+    pub static UCHAR_HEX_DIGIT : UProperty = 13;
+    pub static UCHAR_HYPHEN : UProperty = 14;
+
+    pub static UCHAR_ID_CONTINUE : UProperty = 15;
+    pub static UCHAR_ID_START : UProperty = 16;
+    pub static UCHAR_IDEOGRAPHIC : UProperty = 17;
+    pub static UCHAR_IDS_BINARY_OPERATOR : UProperty = 18;
+
+    pub static UCHAR_IDS_TRINARY_OPERATOR : UProperty = 19;
+    pub static UCHAR_JOIN_CONTROL : UProperty = 20;
+    pub static UCHAR_LOGICAL_ORDER_EXCEPTION : UProperty = 21;
+    pub static UCHAR_LOWERCASE : UProperty = 22;
+
+    pub static UCHAR_MATH : UProperty = 23;
+    pub static UCHAR_NONCHARACTER_CODE_POINT : UProperty = 24;
+    pub static UCHAR_QUOTATION_MARK : UProperty = 25;
+    pub static UCHAR_RADICAL : UProperty = 26;
+
+    pub static UCHAR_SOFT_DOTTED : UProperty = 27;
+    pub static UCHAR_TERMINAL_PUNCTUATION : UProperty = 28;
+    pub static UCHAR_UNIFIED_IDEOGRAPH : UProperty = 29;
+    pub static UCHAR_UPPERCASE : UProperty = 30;
+
+    pub static UCHAR_WHITE_SPACE : UProperty = 31;
+    pub static UCHAR_XID_CONTINUE : UProperty = 32;
+    pub static UCHAR_XID_START : UProperty = 33;
+    pub static UCHAR_CASE_SENSITIVE : UProperty = 34;
+
+    pub static UCHAR_S_TERM : UProperty = 35;
+    pub static UCHAR_VARIATION_SELECTOR : UProperty = 36;
+    pub static UCHAR_NFD_INERT : UProperty = 37;
+    pub static UCHAR_NFKD_INERT : UProperty = 38;
+
+    pub static UCHAR_NFC_INERT : UProperty = 39;
+    pub static UCHAR_NFKC_INERT : UProperty = 40;
+    pub static UCHAR_SEGMENT_STARTER : UProperty = 41;
+    pub static UCHAR_PATTERN_SYNTAX : UProperty = 42;
+
+    pub static UCHAR_PATTERN_WHITE_SPACE : UProperty = 43;
+    pub static UCHAR_POSIX_ALNUM : UProperty = 44;
+    pub static UCHAR_POSIX_BLANK : UProperty = 45;
+    pub static UCHAR_POSIX_GRAPH : UProperty = 46;
+
+    pub static UCHAR_POSIX_PRINT : UProperty = 47;
+    pub static UCHAR_POSIX_XDIGIT : UProperty = 48;
+    pub static UCHAR_CASED : UProperty = 49;
+    pub static UCHAR_CASE_IGNORABLE : UProperty = 50;
+
+    pub static UCHAR_CHANGES_WHEN_LOWERCASED : UProperty = 51;
+    pub static UCHAR_CHANGES_WHEN_UPPERCASED : UProperty = 52;
+    pub static UCHAR_CHANGES_WHEN_TITLECASED : UProperty = 53;
+    pub static UCHAR_CHANGES_WHEN_CASEFOLDED : UProperty = 54;
+
+    pub static UCHAR_CHANGES_WHEN_CASEMAPPED : UProperty = 55;
+    pub static UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED : UProperty = 56;
+    pub static UCHAR_BINARY_LIMIT : UProperty = 57;
+    pub static UCHAR_BIDI_CLASS : UProperty = 0x1000;
+
+    pub static UCHAR_INT_START : UProperty = 0x1000; // UCHAR_BIDI_CLASS
+    pub static UCHAR_BLOCK : UProperty = 0x1001;
+    pub static UCHAR_CANONICAL_COMBINING_CLASS : UProperty = 0x1002;
+    pub static UCHAR_DECOMPOSITION_TYPE : UProperty = 0x1003;
+
+    pub static UCHAR_EAST_ASIAN_WIDTH : UProperty = 0x1004;
+    pub static UCHAR_GENERAL_CATEGORY : UProperty = 0x1005;
+    pub static UCHAR_JOINING_GROUP : UProperty = 0x1006;
+    pub static UCHAR_JOINING_TYPE : UProperty = 0x1007;
+
+    pub static UCHAR_LINE_BREAK : UProperty = 0x1008;
+    pub static UCHAR_NUMERIC_TYPE : UProperty = 0x1009;
+    pub static UCHAR_SCRIPT : UProperty = 0x100A;
+    pub static UCHAR_HANGUL_SYLLABLE_TYPE : UProperty = 0x100B;
+
+    pub static UCHAR_NFD_QUICK_CHECK : UProperty = 0x100C;
+    pub static UCHAR_NFKD_QUICK_CHECK : UProperty = 0x100D;
+    pub static UCHAR_NFC_QUICK_CHECK : UProperty = 0x100E;
+    pub static UCHAR_NFKC_QUICK_CHECK : UProperty = 0x100F;
+
+    pub static UCHAR_LEAD_CANONICAL_COMBINING_CLASS : UProperty = 0x1010;
+    pub static UCHAR_TRAIL_CANONICAL_COMBINING_CLASS : UProperty = 0x1011;
+    pub static UCHAR_GRAPHEME_CLUSTER_BREAK : UProperty = 0x1012;
+    pub static UCHAR_SENTENCE_BREAK : UProperty = 0x1013;
+
+    pub static UCHAR_WORD_BREAK : UProperty = 0x1014;
+    pub static UCHAR_INT_LIMIT : UProperty = 0x1015;
+
+    pub static UCHAR_GENERAL_CATEGORY_MASK : UProperty = 0x2000;
+    pub static UCHAR_MASK_START : UProperty = 0x2000;
     // = UCHAR_GENERAL_CATEGORY_MASK
-    pub const UCHAR_MASK_LIMIT : UProperty = 0x2001;
+    pub static UCHAR_MASK_LIMIT : UProperty = 0x2001;
 
-    pub const UCHAR_NUMERIC_VALUE : UProperty = 0x3000;
-    pub const UCHAR_DOUBLE_START : UProperty = 0x3000;
+    pub static UCHAR_NUMERIC_VALUE : UProperty = 0x3000;
+    pub static UCHAR_DOUBLE_START : UProperty = 0x3000;
     // = UCHAR_NUMERIC_VALUE
-    pub const UCHAR_DOUBLE_LIMIT : UProperty = 0x3001;
+    pub static UCHAR_DOUBLE_LIMIT : UProperty = 0x3001;
 
-    pub const UCHAR_AGE : UProperty = 0x4000;
-    pub const UCHAR_STRING_START : UProperty = 0x4000; // = UCHAR_AGE
-    pub const UCHAR_BIDI_MIRRORING_GLYPH : UProperty = 0x4001;
-    pub const UCHAR_CASE_FOLDING : UProperty = 0x4002;
+    pub static UCHAR_AGE : UProperty = 0x4000;
+    pub static UCHAR_STRING_START : UProperty = 0x4000; // = UCHAR_AGE
+    pub static UCHAR_BIDI_MIRRORING_GLYPH : UProperty = 0x4001;
+    pub static UCHAR_CASE_FOLDING : UProperty = 0x4002;
 
-    pub const UCHAR_ISO_COMMENT : UProperty = 0x4003;
-    pub const UCHAR_LOWERCASE_MAPPING : UProperty = 0x4004;
-    pub const UCHAR_NAME : UProperty = 0x4005;
-    pub const UCHAR_SIMPLE_CASE_FOLDING : UProperty = 0x4006;
+    pub static UCHAR_ISO_COMMENT : UProperty = 0x4003;
+    pub static UCHAR_LOWERCASE_MAPPING : UProperty = 0x4004;
+    pub static UCHAR_NAME : UProperty = 0x4005;
+    pub static UCHAR_SIMPLE_CASE_FOLDING : UProperty = 0x4006;
 
-    pub const UCHAR_SIMPLE_LOWERCASE_MAPPING : UProperty = 0x4007;
-    pub const UCHAR_SIMPLE_TITLECASE_MAPPING : UProperty = 0x4008;
-    pub const UCHAR_SIMPLE_UPPERCASE_MAPPING : UProperty = 0x4009;
-    pub const UCHAR_TITLECASE_MAPPING : UProperty = 0x400A;
+    pub static UCHAR_SIMPLE_LOWERCASE_MAPPING : UProperty = 0x4007;
+    pub static UCHAR_SIMPLE_TITLECASE_MAPPING : UProperty = 0x4008;
+    pub static UCHAR_SIMPLE_UPPERCASE_MAPPING : UProperty = 0x4009;
+    pub static UCHAR_TITLECASE_MAPPING : UProperty = 0x400A;
 
-    pub const UCHAR_UNICODE_1_NAME : UProperty = 0x400B;
-    pub const UCHAR_UPPERCASE_MAPPING : UProperty = 0x400C;
-    pub const UCHAR_STRING_LIMIT : UProperty = 0x400D;
+    pub static UCHAR_UNICODE_1_NAME : UProperty = 0x400B;
+    pub static UCHAR_UPPERCASE_MAPPING : UProperty = 0x400C;
+    pub static UCHAR_STRING_LIMIT : UProperty = 0x400D;
 
-    pub const UCHAR_SCRIPT_EXTENSIONS : UProperty = 0x7000;
-    pub const UCHAR_OTHER_PROPERTY_START : UProperty = 0x7000;
+    pub static UCHAR_SCRIPT_EXTENSIONS : UProperty = 0x7000;
+    pub static UCHAR_OTHER_PROPERTY_START : UProperty = 0x7000;
     // = UCHAR_SCRIPT_EXTENSIONS;
-    pub const UCHAR_OTHER_PROPERTY_LIMIT : UProperty = 0x7001;
+    pub static UCHAR_OTHER_PROPERTY_LIMIT : UProperty = 0x7001;
 
-    pub const UCHAR_INVALID_CODE : UProperty = -1;
+    pub static UCHAR_INVALID_CODE : UProperty = -1;
 
     pub mod libicu {
         #[link_name = "icuuc"]
index c37d9d1c1c4f7ff72fc0f1014f52d7282679cfed..bef88e58a1795877808c77076a278dd96cc64e31 100644 (file)
@@ -132,8 +132,8 @@ pub struct def_id {
     node: node_id,
 }
 
-pub const local_crate: crate_num = 0;
-pub const crate_node_id: node_id = 0;
+pub static local_crate: crate_num = 0;
+pub static crate_node_id: node_id = 0;
 
 #[auto_encode]
 #[auto_decode]
index 46ded7ecf3dd0146d47fa2e8b8c15f92b9b8b037..a69b3e20eb1f17494d623f4a946dec965fb128bd 100644 (file)
@@ -493,7 +493,7 @@ macro_rules! condition (
             mod $c {
                 fn key(_x: @::core::condition::Handler<$in,$out>) { }
 
-                pub const cond :
+                pub static cond :
                     ::core::condition::Condition/&static<$in,$out> =
                     ::core::condition::Condition {
                         name: stringify!($c),
index e2a89d2a28cc153e92d43050304c399e997121af..79adabec9b773a62aa7561ed01f536355dca3224 100644 (file)
 use core::prelude::*;
 
 /// Unary operators have higher precedence than binary
-pub const unop_prec: uint = 100u;
+pub static unop_prec: uint = 100u;
 
 /**
  * Precedence of the `as` operator, which is a binary operator
  * but is not represented in the precedence table.
  */
-pub const as_prec: uint = 11u;
+pub static as_prec: uint = 11u;
 
 /**
  * Maps a token to a record specifying the corresponding binary
index 8b78087e16f7ddeaacc09139e474d7c73941c257..074bb13e19908537372458a9744c3b36695c9c54 100644 (file)
@@ -309,50 +309,50 @@ pub fn is_bar(t: &Token) -> bool {
 pub mod special_idents {
     use ast::ident;
 
-    pub const underscore : ident = ident { repr: 0u };
-    pub const anon : ident = ident { repr: 1u };
-    pub const dtor : ident = ident { repr: 2u }; // 'drop', but that's
+    pub static underscore : ident = ident { repr: 0u };
+    pub static anon : ident = ident { repr: 1u };
+    pub static dtor : ident = ident { repr: 2u }; // 'drop', but that's
                                                  // reserved
-    pub const invalid : ident = ident { repr: 3u }; // ''
-    pub const unary : ident = ident { repr: 4u };
-    pub const not_fn : ident = ident { repr: 5u };
-    pub const idx_fn : ident = ident { repr: 6u };
-    pub const unary_minus_fn : ident = ident { repr: 7u };
-    pub const clownshoes_extensions : ident = ident { repr: 8u };
+    pub static invalid : ident = ident { repr: 3u }; // ''
+    pub static unary : ident = ident { repr: 4u };
+    pub static not_fn : ident = ident { repr: 5u };
+    pub static idx_fn : ident = ident { repr: 6u };
+    pub static unary_minus_fn : ident = ident { repr: 7u };
+    pub static clownshoes_extensions : ident = ident { repr: 8u };
 
-    pub const self_ : ident = ident { repr: 9u }; // 'self'
+    pub static self_ : ident = ident { repr: 9u }; // 'self'
 
     /* for matcher NTs */
-    pub const item : ident = ident { repr: 10u };
-    pub const block : ident = ident { repr: 11u };
-    pub const stmt : ident = ident { repr: 12u };
-    pub const pat : ident = ident { repr: 13u };
-    pub const expr : ident = ident { repr: 14u };
-    pub const ty : ident = ident { repr: 15u };
-    pub const ident : ident = ident { repr: 16u };
-    pub const path : ident = ident { repr: 17u };
-    pub const tt : ident = ident { repr: 18u };
-    pub const matchers : ident = ident { repr: 19u };
-
-    pub const str : ident = ident { repr: 20u }; // for the type
+    pub static item : ident = ident { repr: 10u };
+    pub static block : ident = ident { repr: 11u };
+    pub static stmt : ident = ident { repr: 12u };
+    pub static pat : ident = ident { repr: 13u };
+    pub static expr : ident = ident { repr: 14u };
+    pub static ty : ident = ident { repr: 15u };
+    pub static ident : ident = ident { repr: 16u };
+    pub static path : ident = ident { repr: 17u };
+    pub static tt : ident = ident { repr: 18u };
+    pub static matchers : ident = ident { repr: 19u };
+
+    pub static str : ident = ident { repr: 20u }; // for the type
 
     /* outside of libsyntax */
-    pub const ty_visitor : ident = ident { repr: 21u };
-    pub const arg : ident = ident { repr: 22u };
-    pub const descrim : ident = ident { repr: 23u };
-    pub const clownshoe_abi : ident = ident { repr: 24u };
-    pub const clownshoe_stack_shim : ident = ident { repr: 25u };
-    pub const tydesc : ident = ident { repr: 26u };
-    pub const literally_dtor : ident = ident { repr: 27u };
-    pub const main : ident = ident { repr: 28u };
-    pub const opaque : ident = ident { repr: 29u };
-    pub const blk : ident = ident { repr: 30u };
-    pub const static : ident = ident { repr: 31u };
-    pub const intrinsic : ident = ident { repr: 32u };
-    pub const clownshoes_foreign_mod: ident = ident { repr: 33 };
-    pub const unnamed_field: ident = ident { repr: 34 };
-    pub const c_abi: ident = ident { repr: 35 };
-    pub const type_self: ident = ident { repr: 36 };    // `Self`
+    pub static ty_visitor : ident = ident { repr: 21u };
+    pub static arg : ident = ident { repr: 22u };
+    pub static descrim : ident = ident { repr: 23u };
+    pub static clownshoe_abi : ident = ident { repr: 24u };
+    pub static clownshoe_stack_shim : ident = ident { repr: 25u };
+    pub static tydesc : ident = ident { repr: 26u };
+    pub static literally_dtor : ident = ident { repr: 27u };
+    pub static main : ident = ident { repr: 28u };
+    pub static opaque : ident = ident { repr: 29u };
+    pub static blk : ident = ident { repr: 30u };
+    pub static static : ident = ident { repr: 31u };
+    pub static intrinsic : ident = ident { repr: 32u };
+    pub static clownshoes_foreign_mod: ident = ident { repr: 33 };
+    pub static unnamed_field: ident = ident { repr: 34 };
+    pub static c_abi: ident = ident { repr: 35 };
+    pub static type_self: ident = ident { repr: 36 };    // `Self`
 }
 
 pub struct ident_interner {
index d002267547351aeb53d49df1b01c8ef196f7c1e3..af9cb7b841ef65bd87fbc1ae71dc3ed3e11418b8 100644 (file)
@@ -139,7 +139,7 @@ pub struct print_stack_elt {
     pbreak: print_stack_break
 }
 
-pub const size_infinity: int = 0xffff;
+pub static size_infinity: int = 0xffff;
 
 pub fn mk_printer(out: @io::Writer, linewidth: uint) -> @mut Printer {
     // Yes 3, it makes the ring buffers big enough to never
index ce12e0a7b875f75a799b53031fd6709fdc7fd878..9b061faa2abfa9199741a60222ce87f68b082ae0 100644 (file)
@@ -92,10 +92,10 @@ pub fn rust_printer(writer: @io::Writer, intr: @ident_interner) -> @ps {
     };
 }
 
-pub const indent_unit: uint = 4u;
-pub const match_indent_unit: uint = 2u;
+pub static indent_unit: uint = 4u;
+pub static match_indent_unit: uint = 2u;
 
-pub const default_columns: uint = 78u;
+pub static default_columns: uint = 78u;
 
 // Requires you to pass an input filename and reader so that
 // it can scan the input text for comments and literals to
index 945004ede6de84518702b6e889d6027d3f2258a6..17029b9d3778ae09a6fa036a09de4aa18aba7d4d 100644 (file)
@@ -11,6 +11,6 @@
 pub extern fn bar() {
 }
 
-pub const foopy: &'static str = "hi there";
-pub const uint_val: uint = 12;
-pub const uint_expr: uint = (1 << uint_val) - 1;
+pub static foopy: &'static str = "hi there";
+pub static uint_val: uint = 12;
+pub static uint_expr: uint = (1 << uint_val) - 1;
index 6ce9fce881a6a6d73a733b919a9bbaf3b9649094..97907025bd1a0743217b78bb24e63cbf9a2f15a7 100644 (file)
@@ -167,10 +167,10 @@ pub fn energy(bodies: &[Body::Props]) -> float {
 pub mod Body {
     use Body;
 
-    pub const PI: float = 3.141592653589793;
-    pub const SOLAR_MASS: float = 39.478417604357432;
+    pub static PI: float = 3.141592653589793;
+    pub static SOLAR_MASS: float = 39.478417604357432;
     // was 4 * PI * PI originally
-    pub const DAYS_PER_YEAR: float = 365.24;
+    pub static DAYS_PER_YEAR: float = 365.24;
 
     pub struct Props {
         x: float,
index 1e32697eb1073232af6f64ed844736a67dd3831c..4964cea28ad91e50a51acaace3cbdf66b2a62f86 100644 (file)
@@ -153,7 +153,7 @@ fn drop_colors(&mut self, avail: &mut Colors, row: u8, col: u8) {
 // Stores available colors as simple bitfield, bit 0 is always unset
 struct Colors(u16);
 
-const heads: u16 = (1u16 << 10) - 1; /* bits 9..0 */
+static heads: u16 = (1u16 << 10) - 1; /* bits 9..0 */
 
 impl Colors {
     fn new(start_color: u8) -> Colors {
@@ -182,7 +182,7 @@ fn remove(&mut self, color: u8) {
     }
 }
 
-const default_sudoku: [[u8 * 9] * 9] = [
+static default_sudoku: [[u8 * 9] * 9] = [
          /* 0    1    2    3    4    5    6    7    8    */
   /* 0 */  [0u8, 4u8, 0u8, 6u8, 0u8, 0u8, 0u8, 3u8, 2u8],
   /* 1 */  [0u8, 0u8, 8u8, 0u8, 2u8, 0u8, 0u8, 0u8, 0u8],
@@ -196,7 +196,7 @@ fn remove(&mut self, color: u8) {
 ];
 
 #[cfg(test)]
-const default_solution: [[u8 * 9] * 9] = [
+static default_solution: [[u8 * 9] * 9] = [
          /* 0    1    2    3    4    5    6    7    8    */
   /* 0 */  [1u8, 4u8, 9u8, 6u8, 7u8, 5u8, 8u8, 3u8, 2u8],
   /* 1 */  [5u8, 3u8, 8u8, 1u8, 2u8, 9u8, 7u8, 4u8, 6u8],
index e35d5e79bde65ecfc6b401378ab565ddf6ee7aac..a66c00d5411b47b1e54b1726524a440c8636ab10 100644 (file)
@@ -10,5 +10,5 @@
 
 // error-pattern:expected `~str` but found `int`
 
-const i: str = 10i;
+static i: ~str = 10i;
 fn main() { debug!(i); }
index 78a95cb33c0c312d648ee3012f3380f3c5a2f835..0d65aacb65b7a12540b559567eed7c3c5941f2d7 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const foo: int = 5;
+static foo: int = 5;
 
 fn main() {
     // assigning to various global constants
index 45e39b47d23718ed6fe3b8883094086d4971063b..56ec0bb92963601a890d044e7ba65308f77c5d7a 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const a: &'static str = &"foo";
-const b: *u8 = a as *u8; //~ ERROR non-scalar cast
-const c: *u8 = &a as *u8; //~ ERROR mismatched types
+static a: &'static str = &"foo";
+static b: *u8 = a as *u8; //~ ERROR non-scalar cast
+static c: *u8 = &a as *u8; //~ ERROR mismatched types
 
 fn main() {
-}
\ No newline at end of file
+}
index fe91056d47b6f847b909be3c39b989aea562345d..677f4318db75911c3cf4a9fc97e18ff40e02cdc5 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const a: [u8 * 3] = ['h' as u8, 'i' as u8, 0 as u8];
-const b: *i8 = &a as *i8; //~ ERROR mismatched types
+static a: [u8 * 3] = ['h' as u8, 'i' as u8, 0 as u8];
+static b: *i8 = &a as *i8; //~ ERROR mismatched types
 
 fn main() {
-}
\ No newline at end of file
+}
index f565a44c97f97ad989805df7e871430512d9ccbf..9c633e082b194d567b628d3460fa08202e3730cc 100644 (file)
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 // error-pattern: recursive constant
-const a: int = b;
-const b: int = a;
+static a: int = b;
+static b: int = a;
 
 fn main() {
 }
index 2b52cab7fe79ac28cc646424b22f0c817dc6830c..d5663e57f4bf748648c52e439d1e53d072d45c47 100644 (file)
@@ -12,5 +12,5 @@
 fn foo() -> &'a int {
     return &x;
 }
-const x: int = 5;
+static x: int = 5;
 fn main() {}
index 39c14b4d316b0ce144f3276a33c0d6de32f275fb..431f98d8181a05502519861290c76e8903a9748f 100644 (file)
@@ -11,7 +11,7 @@
 fn main() {
     let foo = 100;
 
-    const y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant
+    static y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant
 
     error!(y);
 }
index be96918b2505544404f69eb95cc8e684303f3462..f7637f684be5af9121c680051c3f5a06a2b3c971 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 fn f(x:int) {
-    const child: int = x + 1; //~ ERROR attempt to use a non-constant value in a constant
+    static child: int = x + 1; //~ ERROR attempt to use a non-constant value in a constant
 }
 
 fn main() {}
index 1b121878697ded52b416e23f8489ea6e21f630d3..77e2e4f21e8a1aa32de28745ce203d2e553322f3 100644 (file)
@@ -15,7 +15,7 @@ trait PTrait {
 
 impl PTrait for P {
    fn getChildOption(&self) -> Option<@P> {
-       const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
+       static childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
        fail!();
    }
 }
index e8e2702937110f064456365b4e6472386e4e65b5..6d072ce210e2d0241df18a11e8dcc97a0790ff4f 100644 (file)
@@ -10,7 +10,7 @@
 
 fn foopy() {}
 
-const f: &'static fn() = foopy; //~ ERROR mismatched types: expected `&'static fn()`
+static f: &'static fn() = foopy; //~ ERROR mismatched types: expected `&'static fn()`
 
 fn main () {
     f();
index 315c2affe349cddaebe4b919248fc65107d1e046..fc0c29e9a79879a13d25f1ee7357b3126eb1ab9e 100644 (file)
@@ -10,7 +10,7 @@
 
 // Regression test for issue #4968
 
-const A: (int,int) = (4,2);
+static A: (int,int) = (4,2);
 fn main() {
     match 42 { A => () } //~ ERROR mismatched types: expected `<VI0>` but found `(int,int)` (expected integral variable but found tuple)
 }
index 2ba27e888cbe03419b16098ff2bf78bd2cc4d6a3..c34e5fb29de5ac71fffa5b992542145c172e3d90 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const c_x: &'blk int = &22; //~ ERROR Illegal lifetime 'blk: only 'static is allowed here
-const c_y: &int = &22; //~ ERROR Illegal anonymous lifetime: only 'static is allowed here
-const c_z: &'static int = &22;
+static c_x: &'blk int = &22; //~ ERROR Illegal lifetime 'blk: only 'static is allowed here
+static c_y: &int = &22; //~ ERROR Illegal anonymous lifetime: only 'static is allowed here
+static c_z: &'static int = &22;
 
 fn main() {
 }
index 613480e3a63cdaa604e9b89e8d0b4bc0b2dc11bf..779fd3e490416999980d1dab0130035d6cf2bd4b 100644 (file)
@@ -63,8 +63,8 @@ fn main() {
     let ty = quote_ty!(int);
     check_pp(ext_cx, ty, pprust::print_type, ~"int");
 
-    let item = quote_item!(const x : int = 10;).get();
-    check_pp(ext_cx, item, pprust::print_item, ~"const x: int = 10;");
+    let item = quote_item!(static x : int = 10;).get();
+    check_pp(ext_cx, item, pprust::print_item, ~"static x: int = 10;");
 
     let stmt = quote_stmt!(let x = 20;);
     check_pp(ext_cx, *stmt, pprust::print_stmt, ~"let x = 20;");
index f324f2d198b0b461e82b1065d37a9a1037dbaf0f..ccee163eafe5be6adb50e8bf5aa71dfe9f500e64 100644 (file)
@@ -19,7 +19,7 @@ fn syntax_extension(ext_cx: @ext_ctxt) {
     let p_toks : ~[syntax::ast::token_tree] = quote_tokens!((x, 1 .. 4, *));
 
     let a: @syntax::ast::expr = quote_expr!(1 + 2);
-    let _b: Option<@syntax::ast::item> = quote_item!( const foo : int = $e_toks; );
+    let _b: Option<@syntax::ast::item> = quote_item!( static foo : int = $e_toks; );
     let _c: @syntax::ast::pat = quote_pat!( (x, 1 .. 4, *) );
     let _d: @syntax::ast::stmt = quote_stmt!( let x = $a; );
     let _e: @syntax::ast::expr = quote_expr!( match foo { $p_toks => 10 } );
index 38854abff47f104d93339a2cc24780a17935bd2f..194f0e71b1733a2f73b6c96083afea68eae75fc1 100644 (file)
@@ -15,9 +15,9 @@
 use flippity;
 
 #[cfg(bogus)]
-const b: bool = false;
+static b: bool = false;
 
-const b: bool = true;
+static b: bool = true;
 
 mod rustrt {
     #[cfg(bogus)]
@@ -102,8 +102,8 @@ fn f() { }
     f();
 
     #[cfg(bogus)]
-    const i: int = 0;
-    const i: int = 1;
+    static i: int = 0;
+    static i: int = 1;
     fail_unless!((i == 1));
 }
 
index cb56ab363356599829612484237ae627e865f58c..a157c46403bf352d0431834890074087750900c1 100644 (file)
@@ -9,8 +9,8 @@
 // except according to those terms.
 
 struct S(&'static [int]);
-const C0: S = S([3]);
-const C1: int = C0[0];
+static C0: S = S([3]);
+static C1: int = C0[0];
 
 pub fn main() {
     fail_unless!(C1 == 3);
index 9fb6c4aa0dbd971eef0118d65bec5df4181a8936..fa482c38d145bd4a1686ab7235b0d1aaf20f1fa3 100644 (file)
@@ -8,10 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const A: [u8 * 1] = ['h' as u8];
-const B: u8 = (&A)[0];
-const C: &'static &'static &'static &'static [u8 * 1] = & & & &A;
-const D: u8 = (&C)[0];
+static A: [u8 * 1] = ['h' as u8];
+static B: u8 = (&A)[0];
+static C: &'static &'static &'static &'static [u8 * 1] = & & & &A;
+static D: u8 = (&C)[0];
 
 pub fn main() {
     fail_unless!(B == A[0]);
index a7d1739a56b9c838947515c8f4439acc190972b0..97544da41c024fb25ad5ee064261882880f3cd1c 100644 (file)
@@ -14,7 +14,7 @@ enum Foo {
     Quux(u64, u16)
 }
 
-const X: Foo = Baz;
+static X: Foo = Baz;
 
 pub fn main() {
     match X {
@@ -34,5 +34,5 @@ pub fn main() {
     }
 }
 
-const Y: Foo = Bar(2654435769);
-const Z: Foo = Quux(0x123456789abcdef0, 0x1234);
+static Y: Foo = Bar(2654435769);
+static Z: Foo = Quux(0x123456789abcdef0, 0x1234);
index 2d7dc349c00850b2f1e935590c38e8443031d6be..eefd1aa642e1c2bc7565d29c04a087d9f17e7a0c 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const a: *u8 = 0 as *u8;
+static a: *u8 = 0 as *u8;
 
 fn main() {
     fail_unless!(a == ptr::null());
index 64c6f368f2bfbd2d61f144f5e9a546ebc9ab0389..83f365a632018458daeb143f3d85054f7c42aa32 100644 (file)
 
 extern fn foo() {}
 
-const x: *u8 = foo;
-const y: *libc::c_void = x as *libc::c_void;
-const a: &'static int = &10;
-const b: *int = a as *int;
+static x: *u8 = foo;
+static y: *libc::c_void = x as *libc::c_void;
+static a: &'static int = &10;
+static b: *int = a as *int;
 
 fn main() {
     fail_unless!(x as *libc::c_void == y);
index 142bcb7f9a8e2f43dc40925ffdc5793acbde6795..3f8a7da4c149d9df36cee9f3dde7c4ca70527408 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const a: int = 1;
-const b: int = a + 2;
+static a: int = 1;
+static b: int = a + 2;
 
 pub fn main() {
     fail_unless!(b == 3);
index 72db11c64e885397ceca0e8d55296afde36efeed..379089cc2a2d2e3ea3617a670eb35e9c176a601a 100644 (file)
 
 // Issue #570
 
-const lsl : int = 1 << 2;
-const add : int = 1 + 2;
-const addf : float = 1.0f + 2.0f;
-const not : int = !0;
-const notb : bool = !true;
-const neg : int = -(1);
+static lsl : int = 1 << 2;
+static add : int = 1 + 2;
+static addf : float = 1.0f + 2.0f;
+static not : int = !0;
+static notb : bool = !true;
+static neg : int = -(1);
 
 pub fn main() {
     fail_unless!((lsl == 4));
index e01519ae8a5479659f8aa270c433f5a3d7100d47..130f43cfddd344fc5165f330894583985ebd6c4e 100644 (file)
@@ -12,9 +12,9 @@
 // aux-build:cci_const.rs
 
 extern mod cci_const;
-const foo: &'static str = cci_const::foopy;
-const a: uint = cci_const::uint_val;
-const b: uint = cci_const::uint_expr + 5;
+static foo: &'static str = cci_const::foopy;
+static a: uint = cci_const::uint_val;
+static b: uint = cci_const::uint_expr + 5;
 
 fn main() {
     fail_unless!(a == 12);
index e1a4fc634bae8992164e7ddeb81df1f73cf262ca..723835a46d8490cde59016842c67237a4b7c3d1e 100644 (file)
@@ -13,7 +13,7 @@
 
 extern mod cci_const;
 use cci_const::bar;
-const foo: *u8 = bar;
+static foo: *u8 = bar;
 
 fn main() {
     fail_unless!(foo == cci_const::bar);
index 71ae273aaa3b25b614dcee97ea5273468ba055ec..a69ca9cb939793ab50cddac50498a106c7d7f93a 100644 (file)
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const C: &'static int = &1000;
-const D: int = *C;
+static C: &'static int = &1000;
+static D: int = *C;
 struct S(&'static int);
-const E: &'static S = &S(C);
-const F: int = ***E;
+static E: &'static S = &S(C);
+static F: int = ***E;
 
 pub fn main() {
     fail_unless!(D == 1000);
index 57cfdd2f9d4708880696d49d99ce6c05537b63b8..c4e1ea727e47ed9e66ed76fd938ca1c948857b73 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V, VV(int) }
-const C: E = V;
+static C: E = V;
 
 pub impl E {
     fn method(&self) {
index a8d24dc300a859f06e4fd8cb4576dc263dbb831d..83fafad4f99bbfcc1b6fe71c229c10b7b2078ce7 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V, VV(int) }
-const C: E = V;
+static C: E = V;
 
 fn f(a: &E) {
     match *a {
index ac0bbfda20d9b26ea0bcccc3946313a027b9a6cb..20d7a94ccacf61b42cab3c3a51624cdabf5ebcc0 100644 (file)
@@ -12,10 +12,10 @@ enum A { A1, A2 }
 enum B { B1=0, B2=2 }
 
 fn main () {
-    const c1: int = A2 as int;
-    const c2: int = B2 as int;
-    const c3: float = A2 as float;
-    const c4: float = B2 as float;
+    static c1: int = A2 as int;
+    static c2: int = B2 as int;
+    static c3: float = A2 as float;
+    static c4: float = B2 as float;
     let a1 = A2 as int;
     let a2 = B2 as int;
     let a3 = A2 as float;
index 594350d29885c9b2b7969d17b19c986b0e98e5f4..c1e3889d613d922dfcd3bd5f6a2ae3d869492379 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V0, V1(int) }
-const C: &'static E = &V0;
+static C: &'static E = &V0;
 
 pub fn main() {
     match *C {
index 8ab470461eb61cb5819d72ec73afd9364c094ace..7da171cc0065352e6fa9a680274e079739a91a7f 100644 (file)
@@ -10,7 +10,7 @@
 
 enum E { V16(u16), V32(u32) }
 struct S { a: E, b: u16, c: u16 }
-const C: S = S { a: V16(0xDEAD), b: 0x600D, c: 0xBAD };
+static C: S = S { a: V16(0xDEAD), b: 0x600D, c: 0xBAD };
 
 pub fn main() {
     let n = C.b;
index 49078b8efe2f26f107c28199d5fdc98e801850bc..c24db8414c41675f6284e6d2d8e781710bcf8f98 100644 (file)
@@ -10,7 +10,7 @@
 
 enum E { V0, V16(u16) }
 struct S { a: E, b: u16, c: u16 }
-const C: S = S { a: V0, b: 0x600D, c: 0xBAD };
+static C: S = S { a: V0, b: 0x600D, c: 0xBAD };
 
 pub fn main() {
     let n = C.b;
index 3faad1fee7e5e19ff80ba51094a758c537ba9890..86640bcc408e1609fdc569c91d465a5bf147bd89 100644 (file)
@@ -13,7 +13,7 @@ enum E {
     S1 { u: uint }
 }
 
-const C: E = S1 { u: 23 };
+static C: E = S1 { u: 23 };
 
 fn main() {
     match C {
index d46207ea8123baa6f4621bea051fb7f528748da7..acefd4ff878b8c48c5da6436e5eda29c02bb00fa 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V16(u16), V32(u32) }
-const C: (E, u16, u16) = (V16(0xDEAD), 0x600D, 0xBAD);
+static C: (E, u16, u16) = (V16(0xDEAD), 0x600D, 0xBAD);
 
 pub fn main() {
     let (_, n, _) = C;
index 08007b5b67d0ed28abba1d468e330a727a4ab8b4..63f1f41d9ab5a46045751bb827392ac8ed9e7da7 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V0, V16(u16) }
-const C: (E, u16, u16) = (V0, 0x600D, 0xBAD);
+static C: (E, u16, u16) = (V0, 0x600D, 0xBAD);
 
 pub fn main() {
     let (_, n, _) = C;
index a88bbca7919d3ec38423476738fb3f88aac66943..b0d321abb09e7702448382bbc605acfd08db8c6e 100644 (file)
@@ -10,7 +10,7 @@
 
 enum E { V16(u16), V32(u32) }
 struct S(E, u16, u16);
-const C: S = S(V16(0xDEAD), 0x600D, 0xBAD);
+static C: S = S(V16(0xDEAD), 0x600D, 0xBAD);
 
 pub fn main() {
     let S(_, n, _) = C;
index 4bbadd40574b524aae8bf584f8f8bd6c2c326ce2..7fa04af3f9a583a3d8a9d023f1cef9e6b01573ee 100644 (file)
@@ -10,7 +10,7 @@
 
 enum E { V0, V16(u16) }
 struct S(E, u16, u16);
-const C: S = S(V0, 0x600D, 0xBAD);
+static C: S = S(V0, 0x600D, 0xBAD);
 
 pub fn main() {
     let S(_, n, _) = C;
index 6dde7cc41ec7cd9ffcf4312988957f4bf92055ce..fd11fc422726f0f9253db2670b6f9638859309fd 100644 (file)
@@ -9,9 +9,9 @@
 // except according to those terms.
 
 enum E { V1(int), V0 }
-const C: &'static [E] = &[V0, V1(0xDEADBEE)];
-const C0: E = C[0];
-const C1: E = C[1];
+static C: &'static [E] = &[V0, V1(0xDEADBEE)];
+static C0: E = C[0];
+static C1: E = C[1];
 
 pub fn main() {
     match C0 { 
index b398bfbf0d5c1ca117823fa2b7a169871977f322..8d152dca54c31366b3aef320c74ea933d8667b76 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V1(int), V0 }
-const C: &'static [E] = &[V0, V1(0xDEADBEE), V0];
+static C: &'static [E] = &[V0, V1(0xDEADBEE), V0];
 
 pub fn main() {
     match C[1] {
index 48b3c774e39699c392872a1a280caaf22cf47551..db7982c451fa09dd1df674e466fa7c5129c72a88 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 enum E { V1(int), V0 }
-const C: [E * 3] = [V0, V1(0xDEADBEE), V0];
+static C: [E * 3] = [V0, V1(0xDEADBEE), V0];
 
 pub fn main() {
     match C[1] {
index aa5c4cbbc1d0fdd9c80ca49d89f47d95f08bb6ab..69585c9d31c9ead2124e6c1927b9cc5b80032721 100644 (file)
@@ -13,7 +13,7 @@
 
 fn main() {
 
-    const FOO: int = 2;
+    static FOO: int = 2;
     let _v: [int * FOO*3];
 
 }
index 76952ef730fa16e71996c30b7519c78dc87cf313..a04c588c07bc1dafb917e610712597586990f27d 100644 (file)
@@ -12,7 +12,7 @@
 
 fn main() {
 
-    const FOO: int = 2;
+    static FOO: int = 2;
     let _v = [0, ..FOO*3*2/2];
 
 }
index 6b6a3e4d0a4e8fc5f1ca27dcc6347af919480181..5e7ac4e4518ae4d5857e1fa984c04e2641d16f42 100644 (file)
@@ -10,8 +10,8 @@
 
 extern fn foopy() {}
 
-const f: *u8 = foopy;
-const s: S = S { f: foopy };
+static f: *u8 = foopy;
+static s: S = S { f: foopy };
 
 struct S {
     f: *u8
index c13215bb23621af6be91ff12e2e812250e29b7fd..a3611c5eb26586a68370aad3ecdfcaf151b72809 100644 (file)
@@ -8,22 +8,21 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const x : [int * 4] = [1,2,3,4];
-const p : int = x[2];
-const y : &'static [int] = &[1,2,3,4];
-const q : int = y[2];
+static x : [int * 4] = [1,2,3,4];
+static p : int = x[2];
+static y : &'static [int] = &[1,2,3,4];
+static q : int = y[2];
 
 struct S {a: int, b: int}
 
-const s : S = S {a: 10, b: 20};
-const t : int = s.b;
+static s : S = S {a: 10, b: 20};
+static t : int = s.b;
 
 struct K {a: int, b: int, c: D}
 struct D { d: int, e: int }
 
-const k : K = K {a: 10, b: 20, c: D {d: 30,
-                                     e: 40}};
-const m : int = k.c.e;
+static k : K = K {a: 10, b: 20, c: D {d: 30, e: 40}};
+static m : int = k.c.e;
 
 pub fn main() {
     io::println(fmt!("%?", p));
index c3d09a58b5b7b82c48a3ac7b1a159d326ef32ad3..1c0cfa64d88f2f4b131c83adefa484d1252534f7 100644 (file)
@@ -14,7 +14,7 @@ fn foo() -> int {
 
 struct Bar { f: &'self fn() -> int }
 
-const b : Bar/&static = Bar { f: foo };
+static b : Bar/&static = Bar { f: foo };
 
 pub fn main() {
     fail_unless!((b.f)() == 0xca7f000d);
index a255082933165909e677612ee0d35a054a76f33a..e2add6409f75dbfc3aaff7c8e01c58481be838c7 100644 (file)
@@ -10,7 +10,7 @@
 
 // Issue #358
 
-const toplevel_mod: int = -1;
+static toplevel_mod: int = -1;
 
 pub fn main() {
     fail_unless!(toplevel_mod == -1);
index cbc862185a8d84f1182018d63173f03018a5464e..bc61c8e9aecf5e47bba25f8abaa74e3d8f0a3e78 100644 (file)
@@ -14,7 +14,7 @@ enum Foo {
     Boo,
 }
 
-const X: Foo = Bar;
+static X: Foo = Bar;
 
 pub fn main() {
     match X {
@@ -27,4 +27,4 @@ pub fn main() {
     }
 }
 
-const Y: Foo = Baz;
+static Y: Foo = Baz;
index 184a9da6fb791200509ce116d20d1c26018169dd..75fd2774095c1eb6042d957e30a87323a5243b80 100644 (file)
@@ -12,11 +12,11 @@ enum Foo {
     Bar = 0xDEADBEE
 }
 
-const X: Foo = Bar;
+static X: Foo = Bar;
 
 pub fn main() {
     fail_unless!(((X as uint) == 0xDEADBEE));
     fail_unless!(((Y as uint) == 0xDEADBEE));
 }
 
-const Y: Foo = Bar;
+static Y: Foo = Bar;
index ff1f3338e444a95450972cde71c417b18d072286..77d4521e7094314997a4cf2bb69c3e55f1f8bd56 100644 (file)
@@ -12,11 +12,11 @@ struct Pair { a: float, b: float }
 
 struct AnotherPair { x: (i64, i64), y: Pair }
 
-const x : (i32,i32) = (0xfeedf00dd,0xca11ab1e);
-const y : AnotherPair = AnotherPair{ x: (0xf0f0f0f0_f0f0f0f0,
-                                         0xabababab_abababab),
-                           y: Pair { a: 3.14159265358979323846,
-                                     b: 2.7182818284590452354 }};
+static x : (i32,i32) = (0xfeedf00dd,0xca11ab1e);
+static y : AnotherPair = AnotherPair{ x: (0xf0f0f0f0_f0f0f0f0,
+                                          0xabababab_abababab),
+                            y: Pair { a: 3.14159265358979323846,
+                                      b: 2.7182818284590452354 }};
 
 pub fn main() {
     let (p, _) = y.x;
index 078ae7661cff4ea6ea78d6e178152fb85062788c..23d1d63f1899613d5cd966213ee707e156c859c4 100644 (file)
@@ -10,8 +10,8 @@
 
 type Big = [u64 * 8];
 struct Pair { a: int, b: &'self Big }
-const x: &'static Big = &([13, 14, 10, 13, 11, 14, 14, 15]);
-const y: &'static Pair<'static> = &Pair {a: 15, b: x};
+static x: &'static Big = &([13, 14, 10, 13, 11, 14, 14, 15]);
+static y: &'static Pair<'static> = &Pair {a: 15, b: x};
 
 pub fn main() {
     fail_unless!(ptr::addr_of(x) == ptr::addr_of(y.b));
index dbb3abe7dafb1ae779fcd6eb1002eae2479e1c29..32c5f65bf3adeb75090f53e1fe86e96bb232ba40 100644 (file)
@@ -11,9 +11,9 @@
 
 struct Pair { a: int, b: &'self int }
 
-const x: &'static int = &10;
+static x: &'static int = &10;
 
-const y: &'static Pair<'static> = &Pair {a: 15, b: x};
+static y: &'static Pair<'static> = &Pair {a: 15, b: x};
 
 pub fn main() {
     io::println(fmt!("x = %?", *x));
index a1637f6ebb831e3adbc0143fdb879300d861d9a9..2560431b53209ebd2b4aa2cca56182962729e34d 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const a: [u8 * 3] = ['h' as u8, 'i' as u8, 0 as u8];
-const c: &'static [u8 * 3] = &a;
-const b: *u8 = c as *u8;
+static a: [u8 * 3] = ['h' as u8, 'i' as u8, 0 as u8];
+static c: &'static [u8 * 3] = &a;
+static b: *u8 = c as *u8;
 
 fn main() {
     let foo = &a as *u8;
index f2b5be4e36ff9e09081efdea7d673a21034c5bb2..a826f7bf564cdafdd216947d357bd9a84c3a7a1b 100644 (file)
@@ -20,9 +20,9 @@ fn eq(&self, other: &foo) -> bool {
     fn ne(&self, other: &foo) -> bool { !(*self).eq(other) }
 }
 
-const x : foo = foo { a:1, b:2, c: 3 };
-const y : foo = foo { b:2, c:3, a: 1 };
-const z : &'static foo = &foo { a: 10, b: 22, c: 12 };
+static x : foo = foo { a:1, b:2, c: 3 };
+static y : foo = foo { b:2, c:3, a: 1 };
+static z : &'static foo = &foo { a: 10, b: 22, c: 12 };
 
 pub fn main() {
     fail_unless!(x.b == 2);
index 9a25a2eb1aa8991a020cbbf2638872bc78c46f0e..857997b29d2643fa225042ea537a9e244a727863 100644 (file)
@@ -10,7 +10,7 @@
 
 struct Bar(int, int);
 
-const X: Bar = Bar(1, 2);
+static X: Bar = Bar(1, 2);
 
 pub fn main() {
     match X {
index bc996314e03353f13b07b1d20d890e03edff4c2d..b4acde098baf36d7592ff48b86441e183fc40426 100644 (file)
@@ -10,7 +10,7 @@
 
 struct Foo;
 
-const X: Foo = Foo;
+static X: Foo = Foo;
 
 pub fn main() {
     match X {
index 5598756ac75a6ab2b711aabd738fed9d0a8ec88c..deb1a0769f73ce344471254272f27630cba5f04d 100644 (file)
@@ -9,16 +9,16 @@
 // except according to those terms.
 
 /*!
- * Try to double-check that const fns have the right size (with or
+ * Try to double-check that static fns have the right size (with or
  * without dummy env ptr, as appropriate) by iterating a size-2 array.
- * If the const size differs from the runtime size, the second element
+ * If the static size differs from the runtime size, the second element
  * should be read as a null or otherwise wrong pointer and crash.
  */
 
 fn f() { }
-const bare_fns: &'static [extern fn()] = &[f, f];
+static bare_fns: &'static [extern fn()] = &[f, f];
 struct S<'self>(&'self fn());
-const closures: &'static [S<'static>] = &[S(f), S(f)];
+static closures: &'static [S<'static>] = &[S(f), S(f)];
 
 pub fn main() {
     for bare_fns.each |&bare_fn| { bare_fn() }
index 1e86ff3515b4fbab90ea5a6c2d2db7e1eff1711c..736335464b24df49a7fd84ba933254c8a5aa8ad8 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const x : [int * 4] = [1,2,3,4];
-const y : &'static [int] = &[1,2,3,4];
+static x : [int * 4] = [1,2,3,4];
+static y : &'static [int] = &[1,2,3,4];
 
 pub fn main() {
     io::println(fmt!("%?", x[1]));
index e935a2cd434d9ba77b386e62e46dc18d58f17231..d9d84c3fd504887908ca9c917c398771ea28b64e 100644 (file)
@@ -10,6 +10,6 @@
 
 
 
-const i: int = 10;
+static i: int = 10;
 
 pub fn main() { debug!("%i", i); }
index e68414958806a4dcbedfef6ad6a45235310d61e0..5e79838c4b7a3df372b8eda1ac4c2c88493f2fd3 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-const FOO: int = 10;
-const BAR: int = 3;
+static FOO: int = 10;
+static BAR: int = 3;
 
 pub fn main() {
     let x: int = 3;
index 1a21fa0a5d75987351faa2177495dc426e97cb99..3e48b8f05baee1d31e341cc0dc6bd9e6d7eaf383 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 
-const tau: float = 2.0*3.14159265358979323;
+static tau: float = 2.0*3.14159265358979323;
 
 struct Point {x: float, y: float}
 struct Size {w: float, h: float}
index ae17d6ca8b3d54ef0b845e8d6456da96bf0a8b1a..6b97c9031f0a9c9d95502262b154c3a9f52d1ebe 100644 (file)
@@ -18,7 +18,7 @@
 mod foo {
     use foo::bar::*;
     pub mod bar {
-        pub const a : int = 10;
+        pub static a : int = 10;
     }
     pub fn zum() {
         let b = a;
index f66ffbd0e0e6578d7320170ff444f9b9dc8490c0..430da7a3f608b512dcf8d80e165622321808b669 100644 (file)
@@ -11,7 +11,7 @@
 mod foo {
     #[nolink]
     pub extern {
-        pub const errno: int;
+        pub static errno: int;
     }
 }
 
index da8dfbf679224f1682c03755153a2b0c9dfd8858..5c8b4be0cee1a4a642bf375639f510378e6b0c36 100644 (file)
@@ -9,5 +9,5 @@
 // except according to those terms.
 
 pub fn main() {
-    const _x: int = 1<<2;
+    static _x: int = 1<<2;
 }
index c769c33390fa5a3da7d332c7f7b2542a17b8bf82..f3a81771c213711f7c7303b4516ef3ed1cdd22e3 100644 (file)
@@ -9,7 +9,7 @@
 // except according to those terms.
 
 // xfail-test
-const generations: uint = 1024+256+128+49;
+static generations: uint = 1024+256+128+49;
 
 fn child_no(x: uint) -> ~fn() {
      || {
index 766bc23173c60ec47e78c593d97e0a8c58964ba5..a571c49c438b7df196d8f9930b43716d972bc80c 100644 (file)
@@ -10,7 +10,7 @@
 
 pub fn main() {
     let foo = 100;
-    const quux: int = 5;
+    static quux: int = 5;
 
     enum Stuff {
         Bar = quux
index 5de3e88acc0e470ab926c57980861068e7dc90a7..24fe671337287db617acdb2bfc4c5504651ce9d2 100644 (file)
@@ -29,7 +29,7 @@ mod test_first_item_in_file_mod {}
 
 mod test_single_attr_outer {
     #[attr = "val"]
-    pub const x: int = 10;
+    pub static x: int = 10;
 
     #[attr = "val"]
     pub fn f() { }
@@ -47,7 +47,7 @@ pub mod rustrt {
 mod test_multi_attr_outer {
     #[attr1 = "val"]
     #[attr2 = "val"]
-    pub const x: int = 10;
+    pub static x: int = 10;
 
     #[attr1 = "val"]
     #[attr2 = "val"]
@@ -72,7 +72,7 @@ struct t {x: int}
 mod test_stmt_single_attr_outer {
     pub fn f() {
         #[attr = "val"]
-        const x: int = 10;
+        static x: int = 10;
 
         #[attr = "val"]
         fn f() { }
@@ -95,7 +95,7 @@ pub fn f() {
 
         #[attr1 = "val"]
         #[attr2 = "val"]
-        const x: int = 10;
+        static x: int = 10;
 
         #[attr1 = "val"]
         #[attr2 = "val"]
index e8cf244c6b18c06b513a745405f2e0404752e3a0..999c6ac2a71d56db0c7806e562ba1602b93e5b38 100644 (file)
@@ -12,5 +12,5 @@
 
 mod inst {
     pub type T = i32;
-    pub const bits: uint = 32;
+    pub static bits: uint = 32;
 }
index 8628d84d4e7dbfb26cdf390ea756fb5fe50afc4e..7f7dd33dc099f2486913c7c4f2c569ef9882da9d 100644 (file)
@@ -12,5 +12,5 @@
 
 use T = self::inst::T;
 
-pub const bits: uint = inst::bits;
+pub static bits: uint = inst::bits;
 pub fn min(x: T, y: T) -> T { if x < y { x } else { y } }
index 20cda911cdd4736ceedd46689cc9fb00e895ef72..799db4ed2125aa8da3058e80ff4d0aaff1cab3cb 100644 (file)
@@ -10,6 +10,6 @@
 
 // xfail-test
 
-const foo: int = 4 >> 1;
+static foo: int = 4 >> 1;
 enum bs { thing = foo }
 pub fn main() { fail_unless!((thing as int == foo)); }
index c6165c1530a22c999a92da4362e17e4495397e4e..cea32fc745ecadfcaa3c951c9d0d4a99ce5bc8ed 100644 (file)
@@ -54,28 +54,28 @@ fn test_expr() {
 }
 
 fn test_const() {
-    const r1_1: uint = 10u >> 2u8;
-    const r2_1: uint = 10u << 4u8;
+    static r1_1: uint = 10u >> 2u8;
+    static r2_1: uint = 10u << 4u8;
     fail_unless!(r1_1 == 2 as uint);
     fail_unless!(r2_1 == 160 as uint);
 
-    const r1_2: u8 = 10u8 >> 2u;
-    const r2_2: u8 = 10u8 << 4u;
+    static r1_2: u8 = 10u8 >> 2u;
+    static r2_2: u8 = 10u8 << 4u;
     fail_unless!(r1_2 == 2 as u8);
     fail_unless!(r2_2 == 160 as u8);
 
-    const r1_3: int = 10 >> 2i8;
-    const r2_3: int = 10 << 4i8;
+    static r1_3: int = 10 >> 2i8;
+    static r2_3: int = 10 << 4i8;
     fail_unless!(r1_3 == 2 as int);
     fail_unless!(r2_3 == 160 as int);
 
-    const r1_4: i8 = 10i8 >> 2;
-    const r2_4: i8 = 10i8 << 4;
+    static r1_4: i8 = 10i8 >> 2;
+    static r2_4: i8 = 10i8 << 4;
     fail_unless!(r1_4 == 2 as i8);
     fail_unless!(r2_4 == 160 as i8);
 
-    const r1_5: uint = 10u >> 2i8;
-    const r2_5: uint = 10u << 4i8;
+    static r1_5: uint = 10u >> 2i8;
+    static r2_5: uint = 10u << 4i8;
     fail_unless!(r1_5 == 2 as uint);
     fail_unless!(r2_5 == 160 as uint);
 }