}
}
-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| {
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.
use uint;
use vec;
- const INITIAL_CAPACITY: uint = 32u; // 2^5
+ static INITIAL_CAPACITY: uint = 32u; // 2^5
struct Bucket<K,V> {
hash: uint,
#[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 {
}
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;
}
}
#[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 {
}
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 {
}
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 {
}
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;
}
}
}
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;
// 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;
}
/*
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;
}
*/
// 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 }
/* 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)]
// 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 }
// 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)]
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;
}
/*
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 }
mod inst {
pub type T = i16;
- pub const bits: uint = ::u16::bits;
+ pub static bits: uint = ::u16::bits;
}
impl NumCast for i16 {
mod inst {
pub type T = i32;
- pub const bits: uint = ::u32::bits;
+ pub static bits: uint = ::u32::bits;
}
impl NumCast for i32 {
mod inst {
pub type T = i64;
- pub const bits: uint = ::u64::bits;
+ pub static bits: uint = ::u64::bits;
}
impl NumCast for i64 {
mod inst {
pub type T = i8;
- pub const bits: uint = ::u8::bits;
+ pub static bits: uint = ::u8::bits;
}
impl NumCast for i8 {
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 {
// 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
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 }
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 {
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 {
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 {
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;
#[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.
}
}
-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];
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];
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")]
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";
}
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";
}
}
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 } )
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;
}
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);
}
}
-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
#[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;
#[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;
#[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);
}
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));
#[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);
}
// 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.
// 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 {
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>),
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, }
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
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};
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,
usage_full: UsageSource/&self
}
-const commands: &'static [Command/&static] = &[
+static commands: &'static [Command/&static] = &[
Command{
cmd: "build",
action: Exec("rustc"),
}
fn usage() {
- const indent: uint = 8;
+ static indent: uint = 8;
io::print(
"The rust tool is a convenience for managing rust source code.\n\
-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"; }
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),
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 {
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 ...
];
}
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()
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.
// 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
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
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:
//
// - 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,
}
// 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,
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, ()>;
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>;
// 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));
}
}
// 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 {
}
// 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,
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)) => {
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| {
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,
}
/// 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)
}
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 {
}
}
- const t: bool = true;
- const f: bool = false;
+ static t: bool = true;
+ static f: bool = false;
let tbl = ~[
/*. add, shift, bit
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
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 {
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();
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
}
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) => {
#[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");
}
#[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(());
#[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"));
}
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"));
}
~"mod imod { } \
extern mod inmod {
} \
- const iconst: int = 0; \
+ static iconst: int = 0; \
fn ifn() { } \
enum ienum { ivar } \
trait itrait { fn a(); } \
#[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"));
}
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);
// 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
#[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 }
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]),
}
}
- const mul_triples: &'static [(&'static [BigDigit],
- &'static [BigDigit],
- &'static [BigDigit])] = &[
+ static mul_triples: &'static [(&'static [BigDigit],
+ &'static [BigDigit],
+ &'static [BigDigit])] = &[
(&[], &[], &[]),
(&[], &[ 1], &[]),
(&[ 2], &[], &[]),
(&[ 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]),
).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]),
}
}
- const mul_triples: &'static [(&'static [BigDigit],
- &'static [BigDigit],
- &'static [BigDigit])] = &[
+ static mul_triples: &'static [(&'static [BigDigit],
+ &'static [BigDigit],
+ &'static [BigDigit])] = &[
(&[], &[], &[]),
(&[], &[ 1], &[]),
(&[ 2], &[], &[]),
(&[ 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]),
use core::vec;
use core::rand;
- const bench_bits : uint = 1 << 14;
+ static bench_bits : uint = 1 << 14;
#[test]
pub fn test_to_str() {
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;
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,
// 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
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 {
}
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);
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(
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,
* 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
*
* 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.
}
// 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
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();
// 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]); }
// 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 {
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;
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);
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"]
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]
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),
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
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 {
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
};
}
-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
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;
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,
// 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 {
}
}
-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],
];
#[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],
// error-pattern:expected `~str` but found `int`
-const i: str = 10i;
+static i: ~str = 10i;
fn main() { debug!(i); }
// 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
// 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
+}
// 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
+}
// 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() {
}
fn foo() -> &'a int {
return &x;
}
-const x: int = 5;
+static x: int = 5;
fn main() {}
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);
}
// 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() {}
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!();
}
}
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();
// 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)
}
// 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() {
}
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;");
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 } );
use flippity;
#[cfg(bogus)]
-const b: bool = false;
+static b: bool = false;
-const b: bool = true;
+static b: bool = true;
mod rustrt {
#[cfg(bogus)]
f();
#[cfg(bogus)]
- const i: int = 0;
- const i: int = 1;
+ static i: int = 0;
+ static i: int = 1;
fail_unless!((i == 1));
}
// 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);
// 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]);
Quux(u64, u16)
}
-const X: Foo = Baz;
+static X: Foo = Baz;
pub fn main() {
match X {
}
}
-const Y: Foo = Bar(2654435769);
-const Z: Foo = Quux(0x123456789abcdef0, 0x1234);
+static Y: Foo = Bar(2654435769);
+static Z: Foo = Quux(0x123456789abcdef0, 0x1234);
// 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());
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);
// 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);
// 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));
// 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);
extern mod cci_const;
use cci_const::bar;
-const foo: *u8 = bar;
+static foo: *u8 = bar;
fn main() {
fail_unless!(foo == cci_const::bar);
// 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);
// except according to those terms.
enum E { V, VV(int) }
-const C: E = V;
+static C: E = V;
pub impl E {
fn method(&self) {
// except according to those terms.
enum E { V, VV(int) }
-const C: E = V;
+static C: E = V;
fn f(a: &E) {
match *a {
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;
// 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 {
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;
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;
S1 { u: uint }
}
-const C: E = S1 { u: 23 };
+static C: E = S1 { u: 23 };
fn main() {
match C {
// 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;
// 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;
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;
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;
// 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 {
// 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] {
// 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] {
fn main() {
- const FOO: int = 2;
+ static FOO: int = 2;
let _v: [int * FOO*3];
}
fn main() {
- const FOO: int = 2;
+ static FOO: int = 2;
let _v = [0, ..FOO*3*2/2];
}
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
// 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));
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);
// Issue #358
-const toplevel_mod: int = -1;
+static toplevel_mod: int = -1;
pub fn main() {
fail_unless!(toplevel_mod == -1);
Boo,
}
-const X: Foo = Bar;
+static X: Foo = Bar;
pub fn main() {
match X {
}
}
-const Y: Foo = Baz;
+static Y: Foo = Baz;
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;
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;
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));
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));
// 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;
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);
struct Bar(int, int);
-const X: Bar = Bar(1, 2);
+static X: Bar = Bar(1, 2);
pub fn main() {
match X {
struct Foo;
-const X: Foo = Foo;
+static X: Foo = Foo;
pub fn main() {
match X {
// 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() }
// 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]));
-const i: int = 10;
+static i: int = 10;
pub fn main() { debug!("%i", i); }
// 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;
// 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}
mod foo {
use foo::bar::*;
pub mod bar {
- pub const a : int = 10;
+ pub static a : int = 10;
}
pub fn zum() {
let b = a;
mod foo {
#[nolink]
pub extern {
- pub const errno: int;
+ pub static errno: int;
}
}
// except according to those terms.
pub fn main() {
- const _x: int = 1<<2;
+ static _x: int = 1<<2;
}
// 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() {
|| {
pub fn main() {
let foo = 100;
- const quux: int = 5;
+ static quux: int = 5;
enum Stuff {
Bar = quux
mod test_single_attr_outer {
#[attr = "val"]
- pub const x: int = 10;
+ pub static x: int = 10;
#[attr = "val"]
pub fn f() { }
mod test_multi_attr_outer {
#[attr1 = "val"]
#[attr2 = "val"]
- pub const x: int = 10;
+ pub static x: int = 10;
#[attr1 = "val"]
#[attr2 = "val"]
mod test_stmt_single_attr_outer {
pub fn f() {
#[attr = "val"]
- const x: int = 10;
+ static x: int = 10;
#[attr = "val"]
fn f() { }
#[attr1 = "val"]
#[attr2 = "val"]
- const x: int = 10;
+ static x: int = 10;
#[attr1 = "val"]
#[attr2 = "val"]
mod inst {
pub type T = i32;
- pub const bits: uint = 32;
+ pub static bits: uint = 32;
}
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 } }
// 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)); }
}
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);
}