librustc: Remove the const
declaration form everywhere
This commit is contained in:
parent
eba3367404
commit
85c9fc6f8f
@ -41,10 +41,10 @@ pub mod rustrt {
|
||||
}
|
||||
}
|
||||
|
||||
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| {
|
||||
|
@ -211,11 +211,11 @@ unsafe fn find_segment_for_frame(fp: *Word, segment: *StackSegment)
|
||||
|
||||
type Memory = uint;
|
||||
|
||||
const task_local_heap: Memory = 1;
|
||||
const exchange_heap: Memory = 2;
|
||||
const stack: Memory = 4;
|
||||
static task_local_heap: Memory = 1;
|
||||
static exchange_heap: Memory = 2;
|
||||
static stack: Memory = 4;
|
||||
|
||||
const need_cleanup: Memory = exchange_heap | stack;
|
||||
static need_cleanup: Memory = exchange_heap | stack;
|
||||
|
||||
// Walks stack, searching for roots of the requested type, and passes
|
||||
// each root to the visitor.
|
||||
|
@ -25,7 +25,7 @@ pub mod linear {
|
||||
use uint;
|
||||
use vec;
|
||||
|
||||
const INITIAL_CAPACITY: uint = 32u; // 2^5
|
||||
static INITIAL_CAPACITY: uint = 32u; // 2^5
|
||||
|
||||
struct Bucket<K,V> {
|
||||
hash: uint,
|
||||
|
@ -732,52 +732,52 @@ pub mod consts {
|
||||
#[cfg(target_os = "win32")]
|
||||
pub mod os {
|
||||
pub mod c95 {
|
||||
pub const EXIT_FAILURE : int = 1;
|
||||
pub const EXIT_SUCCESS : int = 0;
|
||||
pub const RAND_MAX : int = 32767;
|
||||
pub const EOF : int = -1;
|
||||
pub const SEEK_SET : int = 0;
|
||||
pub const SEEK_CUR : int = 1;
|
||||
pub const SEEK_END : int = 2;
|
||||
pub const _IOFBF : int = 0;
|
||||
pub const _IONBF : int = 4;
|
||||
pub const _IOLBF : int = 64;
|
||||
pub const BUFSIZ : uint = 512_u;
|
||||
pub const FOPEN_MAX : uint = 20_u;
|
||||
pub const FILENAME_MAX : uint = 260_u;
|
||||
pub const L_tmpnam : uint = 16_u;
|
||||
pub const TMP_MAX : uint = 32767_u;
|
||||
pub static EXIT_FAILURE : int = 1;
|
||||
pub static EXIT_SUCCESS : int = 0;
|
||||
pub static RAND_MAX : int = 32767;
|
||||
pub static EOF : int = -1;
|
||||
pub static SEEK_SET : int = 0;
|
||||
pub static SEEK_CUR : int = 1;
|
||||
pub static SEEK_END : int = 2;
|
||||
pub static _IOFBF : int = 0;
|
||||
pub static _IONBF : int = 4;
|
||||
pub static _IOLBF : int = 64;
|
||||
pub static BUFSIZ : uint = 512_u;
|
||||
pub static FOPEN_MAX : uint = 20_u;
|
||||
pub static FILENAME_MAX : uint = 260_u;
|
||||
pub static L_tmpnam : uint = 16_u;
|
||||
pub static TMP_MAX : uint = 32767_u;
|
||||
}
|
||||
pub mod c99 {
|
||||
}
|
||||
pub mod posix88 {
|
||||
pub const O_RDONLY : int = 0;
|
||||
pub const O_WRONLY : int = 1;
|
||||
pub const O_RDWR : int = 2;
|
||||
pub const O_APPEND : int = 8;
|
||||
pub const O_CREAT : int = 256;
|
||||
pub const O_EXCL : int = 1024;
|
||||
pub const O_TRUNC : int = 512;
|
||||
pub const S_IFIFO : int = 4096;
|
||||
pub const S_IFCHR : int = 8192;
|
||||
pub const S_IFBLK : int = 12288;
|
||||
pub const S_IFDIR : int = 16384;
|
||||
pub const S_IFREG : int = 32768;
|
||||
pub const S_IFMT : int = 61440;
|
||||
pub const S_IEXEC : int = 64;
|
||||
pub const S_IWRITE : int = 128;
|
||||
pub const S_IREAD : int = 256;
|
||||
pub const S_IRWXU : int = 448;
|
||||
pub const S_IXUSR : int = 64;
|
||||
pub const S_IWUSR : int = 128;
|
||||
pub const S_IRUSR : int = 256;
|
||||
pub const F_OK : int = 0;
|
||||
pub const R_OK : int = 4;
|
||||
pub const W_OK : int = 2;
|
||||
pub const X_OK : int = 1;
|
||||
pub const STDIN_FILENO : int = 0;
|
||||
pub const STDOUT_FILENO : int = 1;
|
||||
pub const STDERR_FILENO : int = 2;
|
||||
pub static O_RDONLY : int = 0;
|
||||
pub static O_WRONLY : int = 1;
|
||||
pub static O_RDWR : int = 2;
|
||||
pub static O_APPEND : int = 8;
|
||||
pub static O_CREAT : int = 256;
|
||||
pub static O_EXCL : int = 1024;
|
||||
pub static O_TRUNC : int = 512;
|
||||
pub static S_IFIFO : int = 4096;
|
||||
pub static S_IFCHR : int = 8192;
|
||||
pub static S_IFBLK : int = 12288;
|
||||
pub static S_IFDIR : int = 16384;
|
||||
pub static S_IFREG : int = 32768;
|
||||
pub static S_IFMT : int = 61440;
|
||||
pub static S_IEXEC : int = 64;
|
||||
pub static S_IWRITE : int = 128;
|
||||
pub static S_IREAD : int = 256;
|
||||
pub static S_IRWXU : int = 448;
|
||||
pub static S_IXUSR : int = 64;
|
||||
pub static S_IWUSR : int = 128;
|
||||
pub static S_IRUSR : int = 256;
|
||||
pub static F_OK : int = 0;
|
||||
pub static R_OK : int = 4;
|
||||
pub static W_OK : int = 2;
|
||||
pub static X_OK : int = 1;
|
||||
pub static STDIN_FILENO : int = 0;
|
||||
pub static STDOUT_FILENO : int = 1;
|
||||
pub static STDERR_FILENO : int = 2;
|
||||
}
|
||||
pub mod posix01 {
|
||||
}
|
||||
@ -786,13 +786,13 @@ pub mod consts {
|
||||
pub mod bsd44 {
|
||||
}
|
||||
pub mod extra {
|
||||
pub const O_TEXT : int = 16384;
|
||||
pub const O_BINARY : int = 32768;
|
||||
pub const O_NOINHERIT: int = 128;
|
||||
pub static O_TEXT : int = 16384;
|
||||
pub static O_BINARY : int = 32768;
|
||||
pub static O_NOINHERIT: int = 128;
|
||||
|
||||
pub const ERROR_SUCCESS : int = 0;
|
||||
pub const ERROR_INSUFFICIENT_BUFFER : int = 122;
|
||||
pub const INVALID_HANDLE_VALUE: int = -1;
|
||||
pub static ERROR_SUCCESS : int = 0;
|
||||
pub static ERROR_INSUFFICIENT_BUFFER : int = 122;
|
||||
pub static INVALID_HANDLE_VALUE: int = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -801,56 +801,56 @@ pub mod consts {
|
||||
#[cfg(target_os = "android")]
|
||||
pub mod os {
|
||||
pub mod c95 {
|
||||
pub const EXIT_FAILURE : int = 1;
|
||||
pub const EXIT_SUCCESS : int = 0;
|
||||
pub const RAND_MAX : int = 2147483647;
|
||||
pub const EOF : int = -1;
|
||||
pub const SEEK_SET : int = 0;
|
||||
pub const SEEK_CUR : int = 1;
|
||||
pub const SEEK_END : int = 2;
|
||||
pub const _IOFBF : int = 0;
|
||||
pub const _IONBF : int = 2;
|
||||
pub const _IOLBF : int = 1;
|
||||
pub const BUFSIZ : uint = 8192_u;
|
||||
pub const FOPEN_MAX : uint = 16_u;
|
||||
pub const FILENAME_MAX : uint = 4096_u;
|
||||
pub const L_tmpnam : uint = 20_u;
|
||||
pub const TMP_MAX : uint = 238328_u;
|
||||
pub static EXIT_FAILURE : int = 1;
|
||||
pub static EXIT_SUCCESS : int = 0;
|
||||
pub static RAND_MAX : int = 2147483647;
|
||||
pub static EOF : int = -1;
|
||||
pub static SEEK_SET : int = 0;
|
||||
pub static SEEK_CUR : int = 1;
|
||||
pub static SEEK_END : int = 2;
|
||||
pub static _IOFBF : int = 0;
|
||||
pub static _IONBF : int = 2;
|
||||
pub static _IOLBF : int = 1;
|
||||
pub static BUFSIZ : uint = 8192_u;
|
||||
pub static FOPEN_MAX : uint = 16_u;
|
||||
pub static FILENAME_MAX : uint = 4096_u;
|
||||
pub static L_tmpnam : uint = 20_u;
|
||||
pub static TMP_MAX : uint = 238328_u;
|
||||
}
|
||||
pub mod c99 {
|
||||
}
|
||||
pub mod posix88 {
|
||||
pub const O_RDONLY : int = 0;
|
||||
pub const O_WRONLY : int = 1;
|
||||
pub const O_RDWR : int = 2;
|
||||
pub const O_APPEND : int = 1024;
|
||||
pub const O_CREAT : int = 64;
|
||||
pub const O_EXCL : int = 128;
|
||||
pub const O_TRUNC : int = 512;
|
||||
pub const S_IFIFO : int = 4096;
|
||||
pub const S_IFCHR : int = 8192;
|
||||
pub const S_IFBLK : int = 24576;
|
||||
pub const S_IFDIR : int = 16384;
|
||||
pub const S_IFREG : int = 32768;
|
||||
pub const S_IFMT : int = 61440;
|
||||
pub const S_IEXEC : int = 64;
|
||||
pub const S_IWRITE : int = 128;
|
||||
pub const S_IREAD : int = 256;
|
||||
pub const S_IRWXU : int = 448;
|
||||
pub const S_IXUSR : int = 64;
|
||||
pub const S_IWUSR : int = 128;
|
||||
pub const S_IRUSR : int = 256;
|
||||
pub const F_OK : int = 0;
|
||||
pub const R_OK : int = 4;
|
||||
pub const W_OK : int = 2;
|
||||
pub const X_OK : int = 1;
|
||||
pub const STDIN_FILENO : int = 0;
|
||||
pub const STDOUT_FILENO : int = 1;
|
||||
pub const STDERR_FILENO : int = 2;
|
||||
pub const F_LOCK : int = 1;
|
||||
pub const F_TEST : int = 3;
|
||||
pub const F_TLOCK : int = 2;
|
||||
pub const F_ULOCK : int = 0;
|
||||
pub static O_RDONLY : int = 0;
|
||||
pub static O_WRONLY : int = 1;
|
||||
pub static O_RDWR : int = 2;
|
||||
pub static O_APPEND : int = 1024;
|
||||
pub static O_CREAT : int = 64;
|
||||
pub static O_EXCL : int = 128;
|
||||
pub static O_TRUNC : int = 512;
|
||||
pub static S_IFIFO : int = 4096;
|
||||
pub static S_IFCHR : int = 8192;
|
||||
pub static S_IFBLK : int = 24576;
|
||||
pub static S_IFDIR : int = 16384;
|
||||
pub static S_IFREG : int = 32768;
|
||||
pub static S_IFMT : int = 61440;
|
||||
pub static S_IEXEC : int = 64;
|
||||
pub static S_IWRITE : int = 128;
|
||||
pub static S_IREAD : int = 256;
|
||||
pub static S_IRWXU : int = 448;
|
||||
pub static S_IXUSR : int = 64;
|
||||
pub static S_IWUSR : int = 128;
|
||||
pub static S_IRUSR : int = 256;
|
||||
pub static F_OK : int = 0;
|
||||
pub static R_OK : int = 4;
|
||||
pub static W_OK : int = 2;
|
||||
pub static X_OK : int = 1;
|
||||
pub static STDIN_FILENO : int = 0;
|
||||
pub static STDOUT_FILENO : int = 1;
|
||||
pub static STDERR_FILENO : int = 2;
|
||||
pub static F_LOCK : int = 1;
|
||||
pub static F_TEST : int = 3;
|
||||
pub static F_TLOCK : int = 2;
|
||||
pub static F_ULOCK : int = 0;
|
||||
}
|
||||
pub mod posix01 {
|
||||
}
|
||||
@ -859,65 +859,65 @@ pub mod consts {
|
||||
pub mod bsd44 {
|
||||
}
|
||||
pub mod extra {
|
||||
pub const O_RSYNC : int = 1052672;
|
||||
pub const O_DSYNC : int = 4096;
|
||||
pub const O_SYNC : int = 1052672;
|
||||
pub static O_RSYNC : int = 1052672;
|
||||
pub static O_DSYNC : int = 4096;
|
||||
pub static O_SYNC : int = 1052672;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "freebsd")]
|
||||
pub mod os {
|
||||
pub mod c95 {
|
||||
pub const EXIT_FAILURE : int = 1;
|
||||
pub const EXIT_SUCCESS : int = 0;
|
||||
pub const RAND_MAX : int = 2147483647;
|
||||
pub const EOF : int = -1;
|
||||
pub const SEEK_SET : int = 0;
|
||||
pub const SEEK_CUR : int = 1;
|
||||
pub const SEEK_END : int = 2;
|
||||
pub const _IOFBF : int = 0;
|
||||
pub const _IONBF : int = 2;
|
||||
pub const _IOLBF : int = 1;
|
||||
pub const BUFSIZ : uint = 1024_u;
|
||||
pub const FOPEN_MAX : uint = 20_u;
|
||||
pub const FILENAME_MAX : uint = 1024_u;
|
||||
pub const L_tmpnam : uint = 1024_u;
|
||||
pub const TMP_MAX : uint = 308915776_u;
|
||||
pub static EXIT_FAILURE : int = 1;
|
||||
pub static EXIT_SUCCESS : int = 0;
|
||||
pub static RAND_MAX : int = 2147483647;
|
||||
pub static EOF : int = -1;
|
||||
pub static SEEK_SET : int = 0;
|
||||
pub static SEEK_CUR : int = 1;
|
||||
pub static SEEK_END : int = 2;
|
||||
pub static _IOFBF : int = 0;
|
||||
pub static _IONBF : int = 2;
|
||||
pub static _IOLBF : int = 1;
|
||||
pub static BUFSIZ : uint = 1024_u;
|
||||
pub static FOPEN_MAX : uint = 20_u;
|
||||
pub static FILENAME_MAX : uint = 1024_u;
|
||||
pub static L_tmpnam : uint = 1024_u;
|
||||
pub static TMP_MAX : uint = 308915776_u;
|
||||
}
|
||||
pub mod c99 {
|
||||
}
|
||||
pub mod posix88 {
|
||||
pub const O_RDONLY : int = 0;
|
||||
pub const O_WRONLY : int = 1;
|
||||
pub const O_RDWR : int = 2;
|
||||
pub const O_APPEND : int = 8;
|
||||
pub const O_CREAT : int = 512;
|
||||
pub const O_EXCL : int = 2048;
|
||||
pub const O_TRUNC : int = 1024;
|
||||
pub const S_IFIFO : int = 4096;
|
||||
pub const S_IFCHR : int = 8192;
|
||||
pub const S_IFBLK : int = 24576;
|
||||
pub const S_IFDIR : int = 16384;
|
||||
pub const S_IFREG : int = 32768;
|
||||
pub const S_IFMT : int = 61440;
|
||||
pub const S_IEXEC : int = 64;
|
||||
pub const S_IWRITE : int = 128;
|
||||
pub const S_IREAD : int = 256;
|
||||
pub const S_IRWXU : int = 448;
|
||||
pub const S_IXUSR : int = 64;
|
||||
pub const S_IWUSR : int = 128;
|
||||
pub const S_IRUSR : int = 256;
|
||||
pub const F_OK : int = 0;
|
||||
pub const R_OK : int = 4;
|
||||
pub const W_OK : int = 2;
|
||||
pub const X_OK : int = 1;
|
||||
pub const STDIN_FILENO : int = 0;
|
||||
pub const STDOUT_FILENO : int = 1;
|
||||
pub const STDERR_FILENO : int = 2;
|
||||
pub const F_LOCK : int = 1;
|
||||
pub const F_TEST : int = 3;
|
||||
pub const F_TLOCK : int = 2;
|
||||
pub const F_ULOCK : int = 0;
|
||||
pub static O_RDONLY : int = 0;
|
||||
pub static O_WRONLY : int = 1;
|
||||
pub static O_RDWR : int = 2;
|
||||
pub static O_APPEND : int = 8;
|
||||
pub static O_CREAT : int = 512;
|
||||
pub static O_EXCL : int = 2048;
|
||||
pub static O_TRUNC : int = 1024;
|
||||
pub static S_IFIFO : int = 4096;
|
||||
pub static S_IFCHR : int = 8192;
|
||||
pub static S_IFBLK : int = 24576;
|
||||
pub static S_IFDIR : int = 16384;
|
||||
pub static S_IFREG : int = 32768;
|
||||
pub static S_IFMT : int = 61440;
|
||||
pub static S_IEXEC : int = 64;
|
||||
pub static S_IWRITE : int = 128;
|
||||
pub static S_IREAD : int = 256;
|
||||
pub static S_IRWXU : int = 448;
|
||||
pub static S_IXUSR : int = 64;
|
||||
pub static S_IWUSR : int = 128;
|
||||
pub static S_IRUSR : int = 256;
|
||||
pub static F_OK : int = 0;
|
||||
pub static R_OK : int = 4;
|
||||
pub static W_OK : int = 2;
|
||||
pub static X_OK : int = 1;
|
||||
pub static STDIN_FILENO : int = 0;
|
||||
pub static STDOUT_FILENO : int = 1;
|
||||
pub static STDERR_FILENO : int = 2;
|
||||
pub static F_LOCK : int = 1;
|
||||
pub static F_TEST : int = 3;
|
||||
pub static F_TLOCK : int = 2;
|
||||
pub static F_ULOCK : int = 0;
|
||||
}
|
||||
pub mod posix01 {
|
||||
}
|
||||
@ -926,66 +926,66 @@ pub mod consts {
|
||||
pub mod bsd44 {
|
||||
}
|
||||
pub mod extra {
|
||||
pub const O_SYNC : int = 128;
|
||||
pub const CTL_KERN: int = 1;
|
||||
pub const KERN_PROC: int = 14;
|
||||
pub const KERN_PROC_PATHNAME: int = 12;
|
||||
pub static O_SYNC : int = 128;
|
||||
pub static CTL_KERN: int = 1;
|
||||
pub static KERN_PROC: int = 14;
|
||||
pub static KERN_PROC_PATHNAME: int = 12;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod os {
|
||||
pub mod c95 {
|
||||
pub const EXIT_FAILURE : int = 1;
|
||||
pub const EXIT_SUCCESS : int = 0;
|
||||
pub const RAND_MAX : int = 2147483647;
|
||||
pub const EOF : int = -1;
|
||||
pub const SEEK_SET : int = 0;
|
||||
pub const SEEK_CUR : int = 1;
|
||||
pub const SEEK_END : int = 2;
|
||||
pub const _IOFBF : int = 0;
|
||||
pub const _IONBF : int = 2;
|
||||
pub const _IOLBF : int = 1;
|
||||
pub const BUFSIZ : uint = 1024_u;
|
||||
pub const FOPEN_MAX : uint = 20_u;
|
||||
pub const FILENAME_MAX : uint = 1024_u;
|
||||
pub const L_tmpnam : uint = 1024_u;
|
||||
pub const TMP_MAX : uint = 308915776_u;
|
||||
pub static EXIT_FAILURE : int = 1;
|
||||
pub static EXIT_SUCCESS : int = 0;
|
||||
pub static RAND_MAX : int = 2147483647;
|
||||
pub static EOF : int = -1;
|
||||
pub static SEEK_SET : int = 0;
|
||||
pub static SEEK_CUR : int = 1;
|
||||
pub static SEEK_END : int = 2;
|
||||
pub static _IOFBF : int = 0;
|
||||
pub static _IONBF : int = 2;
|
||||
pub static _IOLBF : int = 1;
|
||||
pub static BUFSIZ : uint = 1024_u;
|
||||
pub static FOPEN_MAX : uint = 20_u;
|
||||
pub static FILENAME_MAX : uint = 1024_u;
|
||||
pub static L_tmpnam : uint = 1024_u;
|
||||
pub static TMP_MAX : uint = 308915776_u;
|
||||
}
|
||||
pub mod c99 {
|
||||
}
|
||||
pub mod posix88 {
|
||||
pub const O_RDONLY : int = 0;
|
||||
pub const O_WRONLY : int = 1;
|
||||
pub const O_RDWR : int = 2;
|
||||
pub const O_APPEND : int = 8;
|
||||
pub const O_CREAT : int = 512;
|
||||
pub const O_EXCL : int = 2048;
|
||||
pub const O_TRUNC : int = 1024;
|
||||
pub const S_IFIFO : int = 4096;
|
||||
pub const S_IFCHR : int = 8192;
|
||||
pub const S_IFBLK : int = 24576;
|
||||
pub const S_IFDIR : int = 16384;
|
||||
pub const S_IFREG : int = 32768;
|
||||
pub const S_IFMT : int = 61440;
|
||||
pub const S_IEXEC : int = 64;
|
||||
pub const S_IWRITE : int = 128;
|
||||
pub const S_IREAD : int = 256;
|
||||
pub const S_IRWXU : int = 448;
|
||||
pub const S_IXUSR : int = 64;
|
||||
pub const S_IWUSR : int = 128;
|
||||
pub const S_IRUSR : int = 256;
|
||||
pub const F_OK : int = 0;
|
||||
pub const R_OK : int = 4;
|
||||
pub const W_OK : int = 2;
|
||||
pub const X_OK : int = 1;
|
||||
pub const STDIN_FILENO : int = 0;
|
||||
pub const STDOUT_FILENO : int = 1;
|
||||
pub const STDERR_FILENO : int = 2;
|
||||
pub const F_LOCK : int = 1;
|
||||
pub const F_TEST : int = 3;
|
||||
pub const F_TLOCK : int = 2;
|
||||
pub const F_ULOCK : int = 0;
|
||||
pub static O_RDONLY : int = 0;
|
||||
pub static O_WRONLY : int = 1;
|
||||
pub static O_RDWR : int = 2;
|
||||
pub static O_APPEND : int = 8;
|
||||
pub static O_CREAT : int = 512;
|
||||
pub static O_EXCL : int = 2048;
|
||||
pub static O_TRUNC : int = 1024;
|
||||
pub static S_IFIFO : int = 4096;
|
||||
pub static S_IFCHR : int = 8192;
|
||||
pub static S_IFBLK : int = 24576;
|
||||
pub static S_IFDIR : int = 16384;
|
||||
pub static S_IFREG : int = 32768;
|
||||
pub static S_IFMT : int = 61440;
|
||||
pub static S_IEXEC : int = 64;
|
||||
pub static S_IWRITE : int = 128;
|
||||
pub static S_IREAD : int = 256;
|
||||
pub static S_IRWXU : int = 448;
|
||||
pub static S_IXUSR : int = 64;
|
||||
pub static S_IWUSR : int = 128;
|
||||
pub static S_IRUSR : int = 256;
|
||||
pub static F_OK : int = 0;
|
||||
pub static R_OK : int = 4;
|
||||
pub static W_OK : int = 2;
|
||||
pub static X_OK : int = 1;
|
||||
pub static STDIN_FILENO : int = 0;
|
||||
pub static STDOUT_FILENO : int = 1;
|
||||
pub static STDERR_FILENO : int = 2;
|
||||
pub static F_LOCK : int = 1;
|
||||
pub static F_TEST : int = 3;
|
||||
pub static F_TLOCK : int = 2;
|
||||
pub static F_ULOCK : int = 0;
|
||||
}
|
||||
pub mod posix01 {
|
||||
}
|
||||
@ -994,9 +994,9 @@ pub mod consts {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ use ptr;
|
||||
|
||||
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;
|
||||
|
||||
|
@ -174,33 +174,33 @@ pub mod c_float_utils {
|
||||
// FIXME obtain machine float/math constants automatically (Issue #1986)
|
||||
|
||||
pub mod c_float_targ_consts {
|
||||
pub const radix: uint = 2u;
|
||||
pub const mantissa_digits: uint = 24u;
|
||||
pub const digits: uint = 6u;
|
||||
pub const min_exp: uint = -125u;
|
||||
pub const max_exp: uint = 128u;
|
||||
pub const min_10_exp: int = -37;
|
||||
pub const max_10_exp: int = 38;
|
||||
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
|
||||
pub static radix: uint = 2u;
|
||||
pub static mantissa_digits: uint = 24u;
|
||||
pub static digits: uint = 6u;
|
||||
pub static min_exp: uint = -125u;
|
||||
pub static max_exp: uint = 128u;
|
||||
pub static min_10_exp: int = -37;
|
||||
pub static max_10_exp: int = 38;
|
||||
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) staticants
|
||||
// below.
|
||||
pub const min_value: f32 = 1.175494e-38_f32;
|
||||
pub const max_value: f32 = 3.402823e+38_f32;
|
||||
pub const epsilon: f32 = 0.000000_f32;
|
||||
pub static min_value: f32 = 1.175494e-38_f32;
|
||||
pub static max_value: f32 = 3.402823e+38_f32;
|
||||
pub static epsilon: f32 = 0.000000_f32;
|
||||
}
|
||||
|
||||
pub mod c_double_targ_consts {
|
||||
pub const radix: uint = 2u;
|
||||
pub const mantissa_digits: uint = 53u;
|
||||
pub const digits: uint = 15u;
|
||||
pub const min_exp: uint = -1021u;
|
||||
pub const max_exp: uint = 1024u;
|
||||
pub const min_10_exp: int = -307;
|
||||
pub const max_10_exp: int = 308;
|
||||
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) constants
|
||||
pub static radix: uint = 2u;
|
||||
pub static mantissa_digits: uint = 53u;
|
||||
pub static digits: uint = 15u;
|
||||
pub static min_exp: uint = -1021u;
|
||||
pub static max_exp: uint = 1024u;
|
||||
pub static min_10_exp: int = -307;
|
||||
pub static max_10_exp: int = 308;
|
||||
// FIXME (#1433): this is wrong, replace with hexadecimal (%a) staticants
|
||||
// below.
|
||||
pub const min_value: f64 = 2.225074e-308_f64;
|
||||
pub const max_value: f64 = 1.797693e+308_f64;
|
||||
pub const epsilon: f64 = 2.220446e-16_f64;
|
||||
pub static min_value: f64 = 2.225074e-308_f64;
|
||||
pub static max_value: f64 = 1.797693e+308_f64;
|
||||
pub static epsilon: f64 = 2.220446e-16_f64;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -208,61 +208,61 @@ pub mod c_double_targ_consts {
|
||||
FIXME use these once they can be parsed (see Issue #1433)
|
||||
|
||||
pub mod c_float_math_consts {
|
||||
pub const pi: c_float = 0x1.921fb6p+1_f32;
|
||||
pub const div_1_pi: c_float = 0x1.45f306p-2_f32;
|
||||
pub const div_2_pi: c_float = 0x1.45f306p-1_f32;
|
||||
pub const div_pi_2: c_float = 0x1.921fb6p+0_f32;
|
||||
pub const div_pi_4: c_float = 0x1.921fb6p-1_f32;
|
||||
pub const div_2_sqrtpi: c_float = 0x1.20dd76p+0_f32;
|
||||
pub const e: c_float = 0x1.5bf0a8p+1_f32;
|
||||
pub const log2_e: c_float = 0x1.715476p+0_f32;
|
||||
pub const log10_e: c_float = 0x1.bcb7b2p-2_f32;
|
||||
pub const ln_2: c_float = 0x1.62e43p-1_f32;
|
||||
pub const ln_10: c_float = 0x1.26bb1cp+1_f32;
|
||||
pub const sqrt2: c_float = 0x1.6a09e6p+0_f32;
|
||||
pub const div_1_sqrt2: c_float = 0x1.6a09e6p-1_f32;
|
||||
pub static pi: c_float = 0x1.921fb6p+1_f32;
|
||||
pub static div_1_pi: c_float = 0x1.45f306p-2_f32;
|
||||
pub static div_2_pi: c_float = 0x1.45f306p-1_f32;
|
||||
pub static div_pi_2: c_float = 0x1.921fb6p+0_f32;
|
||||
pub static div_pi_4: c_float = 0x1.921fb6p-1_f32;
|
||||
pub static div_2_sqrtpi: c_float = 0x1.20dd76p+0_f32;
|
||||
pub static e: c_float = 0x1.5bf0a8p+1_f32;
|
||||
pub static log2_e: c_float = 0x1.715476p+0_f32;
|
||||
pub static log10_e: c_float = 0x1.bcb7b2p-2_f32;
|
||||
pub static ln_2: c_float = 0x1.62e43p-1_f32;
|
||||
pub static ln_10: c_float = 0x1.26bb1cp+1_f32;
|
||||
pub static sqrt2: c_float = 0x1.6a09e6p+0_f32;
|
||||
pub static div_1_sqrt2: c_float = 0x1.6a09e6p-1_f32;
|
||||
}
|
||||
|
||||
pub mod c_double_math_consts {
|
||||
pub const pi: c_double = 0x1.921fb54442d18p+1_f64;
|
||||
pub const div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64;
|
||||
pub const div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64;
|
||||
pub const div_pi_2: c_double = 0x1.921fb54442d18p+0_f64;
|
||||
pub const div_pi_4: c_double = 0x1.921fb54442d18p-1_f64;
|
||||
pub const div_2_sqrtpi: c_double = 0x1.20dd750429b6dp+0_f64;
|
||||
pub const e: c_double = 0x1.5bf0a8b145769p+1_f64;
|
||||
pub const log2_e: c_double = 0x1.71547652b82fep+0_f64;
|
||||
pub const log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
|
||||
pub const ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
|
||||
pub const ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
|
||||
pub const sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
|
||||
pub const div_1_sqrt2: c_double = 0x1.6a09e667f3bcdp-1_f64;
|
||||
pub static pi: c_double = 0x1.921fb54442d18p+1_f64;
|
||||
pub static div_1_pi: c_double = 0x1.45f306dc9c883p-2_f64;
|
||||
pub static div_2_pi: c_double = 0x1.45f306dc9c883p-1_f64;
|
||||
pub static div_pi_2: c_double = 0x1.921fb54442d18p+0_f64;
|
||||
pub static div_pi_4: c_double = 0x1.921fb54442d18p-1_f64;
|
||||
pub static div_2_sqrtpi: c_double = 0x1.20dd750429b6dp+0_f64;
|
||||
pub static e: c_double = 0x1.5bf0a8b145769p+1_f64;
|
||||
pub static log2_e: c_double = 0x1.71547652b82fep+0_f64;
|
||||
pub static log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
|
||||
pub static ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
|
||||
pub static ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
|
||||
pub static sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
|
||||
pub static div_1_sqrt2: c_double = 0x1.6a09e667f3bcdp-1_f64;
|
||||
}
|
||||
|
||||
pub mod c_float_targ_consts {
|
||||
pub const radix: uint = 2u;
|
||||
pub const mantissa_digits: uint = 24u;
|
||||
pub const digits: uint = 6u;
|
||||
pub const min_exp: int = -125;
|
||||
pub const max_exp: int = 128;
|
||||
pub const min_10_exp: int = -37;
|
||||
pub const max_10_exp: int = 38;
|
||||
pub const min_value: c_float = 0x1p-126_f32;
|
||||
pub const max_value: c_float = 0x1.fffffep+127_f32;
|
||||
pub const epsilon: c_float = 0x1p-23_f32;
|
||||
pub static radix: uint = 2u;
|
||||
pub static mantissa_digits: uint = 24u;
|
||||
pub static digits: uint = 6u;
|
||||
pub static min_exp: int = -125;
|
||||
pub static max_exp: int = 128;
|
||||
pub static min_10_exp: int = -37;
|
||||
pub static max_10_exp: int = 38;
|
||||
pub static min_value: c_float = 0x1p-126_f32;
|
||||
pub static max_value: c_float = 0x1.fffffep+127_f32;
|
||||
pub static epsilon: c_float = 0x1p-23_f32;
|
||||
}
|
||||
|
||||
pub mod c_double_targ_consts {
|
||||
pub const radix: uint = 2u;
|
||||
pub const mantissa_digits: uint = 53u;
|
||||
pub const digits: uint = 15u;
|
||||
pub const min_exp: int = -1021;
|
||||
pub const max_exp: int = 1024;
|
||||
pub const min_10_exp: int = -307;
|
||||
pub const max_10_exp: int = 308;
|
||||
pub const min_value: c_double = 0x1p-1022_f64;
|
||||
pub const max_value: c_double = 0x1.fffffffffffffp+1023_f64;
|
||||
pub const epsilon: c_double = 0x1p-52_f64;
|
||||
pub static radix: uint = 2u;
|
||||
pub static mantissa_digits: uint = 53u;
|
||||
pub static digits: uint = 15u;
|
||||
pub static min_exp: int = -1021;
|
||||
pub static max_exp: int = 1024;
|
||||
pub static min_10_exp: int = -307;
|
||||
pub static max_10_exp: int = 308;
|
||||
pub static min_value: c_double = 0x1p-1022_f64;
|
||||
pub static max_value: c_double = 0x1.fffffffffffffp+1023_f64;
|
||||
pub static epsilon: c_double = 0x1p-52_f64;
|
||||
}
|
||||
|
||||
*/
|
||||
|
@ -102,11 +102,11 @@ delegate!(fn trunc(n: c_float) -> c_float = cmath::c_float_utils::trunc)
|
||||
// These are not defined inside consts:: for consistency with
|
||||
// the integer types
|
||||
|
||||
pub const NaN: f32 = 0.0_f32/0.0_f32;
|
||||
pub static NaN: f32 = 0.0_f32/0.0_f32;
|
||||
|
||||
pub const infinity: f32 = 1.0_f32/0.0_f32;
|
||||
pub static infinity: f32 = 1.0_f32/0.0_f32;
|
||||
|
||||
pub const neg_infinity: f32 = -1.0_f32/0.0_f32;
|
||||
pub static neg_infinity: f32 = -1.0_f32/0.0_f32;
|
||||
|
||||
#[inline(always)]
|
||||
pub fn is_NaN(f: f32) -> bool { f != f }
|
||||
@ -206,45 +206,45 @@ pub fn is_finite(x: f32) -> bool {
|
||||
/* Module: consts */
|
||||
pub mod consts {
|
||||
// FIXME (requires Issue #1433 to fix): replace with mathematical
|
||||
// constants from cmath.
|
||||
/// Archimedes' constant
|
||||
pub const pi: f32 = 3.14159265358979323846264338327950288_f32;
|
||||
// staticants from cmath.
|
||||
/// Archimedes' staticant
|
||||
pub static pi: f32 = 3.14159265358979323846264338327950288_f32;
|
||||
|
||||
/// pi/2.0
|
||||
pub const frac_pi_2: f32 = 1.57079632679489661923132169163975144_f32;
|
||||
pub static frac_pi_2: f32 = 1.57079632679489661923132169163975144_f32;
|
||||
|
||||
/// pi/4.0
|
||||
pub const frac_pi_4: f32 = 0.785398163397448309615660845819875721_f32;
|
||||
pub static frac_pi_4: f32 = 0.785398163397448309615660845819875721_f32;
|
||||
|
||||
/// 1.0/pi
|
||||
pub const frac_1_pi: f32 = 0.318309886183790671537767526745028724_f32;
|
||||
pub static frac_1_pi: f32 = 0.318309886183790671537767526745028724_f32;
|
||||
|
||||
/// 2.0/pi
|
||||
pub const frac_2_pi: f32 = 0.636619772367581343075535053490057448_f32;
|
||||
pub static frac_2_pi: f32 = 0.636619772367581343075535053490057448_f32;
|
||||
|
||||
/// 2.0/sqrt(pi)
|
||||
pub const frac_2_sqrtpi: f32 = 1.12837916709551257389615890312154517_f32;
|
||||
pub static frac_2_sqrtpi: f32 = 1.12837916709551257389615890312154517_f32;
|
||||
|
||||
/// sqrt(2.0)
|
||||
pub const sqrt2: f32 = 1.41421356237309504880168872420969808_f32;
|
||||
pub static sqrt2: f32 = 1.41421356237309504880168872420969808_f32;
|
||||
|
||||
/// 1.0/sqrt(2.0)
|
||||
pub const frac_1_sqrt2: f32 = 0.707106781186547524400844362104849039_f32;
|
||||
pub static frac_1_sqrt2: f32 = 0.707106781186547524400844362104849039_f32;
|
||||
|
||||
/// Euler's number
|
||||
pub const e: f32 = 2.71828182845904523536028747135266250_f32;
|
||||
pub static e: f32 = 2.71828182845904523536028747135266250_f32;
|
||||
|
||||
/// log2(e)
|
||||
pub const log2_e: f32 = 1.44269504088896340735992468100189214_f32;
|
||||
pub static log2_e: f32 = 1.44269504088896340735992468100189214_f32;
|
||||
|
||||
/// log10(e)
|
||||
pub const log10_e: f32 = 0.434294481903251827651128918916605082_f32;
|
||||
pub static log10_e: f32 = 0.434294481903251827651128918916605082_f32;
|
||||
|
||||
/// ln(2.0)
|
||||
pub const ln_2: f32 = 0.693147180559945309417232121458176568_f32;
|
||||
pub static ln_2: f32 = 0.693147180559945309417232121458176568_f32;
|
||||
|
||||
/// ln(10.0)
|
||||
pub const ln_10: f32 = 2.30258509299404568401799145468436421_f32;
|
||||
pub static ln_10: f32 = 2.30258509299404568401799145468436421_f32;
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
@ -113,27 +113,27 @@ delegate!(fn yn(i: c_int, n: c_double) -> c_double =
|
||||
// These are not defined inside consts:: for consistency with
|
||||
// the integer types
|
||||
|
||||
pub const radix: uint = 2u;
|
||||
pub static radix: uint = 2u;
|
||||
|
||||
pub const mantissa_digits: uint = 53u;
|
||||
pub const digits: uint = 15u;
|
||||
pub static mantissa_digits: uint = 53u;
|
||||
pub static digits: uint = 15u;
|
||||
|
||||
pub const epsilon: f64 = 2.2204460492503131e-16_f64;
|
||||
pub static epsilon: f64 = 2.2204460492503131e-16_f64;
|
||||
|
||||
pub const min_value: f64 = 2.2250738585072014e-308_f64;
|
||||
pub const max_value: f64 = 1.7976931348623157e+308_f64;
|
||||
pub static min_value: f64 = 2.2250738585072014e-308_f64;
|
||||
pub static max_value: f64 = 1.7976931348623157e+308_f64;
|
||||
|
||||
pub const min_exp: int = -1021;
|
||||
pub const max_exp: int = 1024;
|
||||
pub static min_exp: int = -1021;
|
||||
pub static max_exp: int = 1024;
|
||||
|
||||
pub const min_10_exp: int = -307;
|
||||
pub const max_10_exp: int = 308;
|
||||
pub static min_10_exp: int = -307;
|
||||
pub static max_10_exp: int = 308;
|
||||
|
||||
pub const NaN: f64 = 0.0_f64/0.0_f64;
|
||||
pub static NaN: f64 = 0.0_f64/0.0_f64;
|
||||
|
||||
pub const infinity: f64 = 1.0_f64/0.0_f64;
|
||||
pub static infinity: f64 = 1.0_f64/0.0_f64;
|
||||
|
||||
pub const neg_infinity: f64 = -1.0_f64/0.0_f64;
|
||||
pub static neg_infinity: f64 = -1.0_f64/0.0_f64;
|
||||
|
||||
#[inline(always)]
|
||||
pub fn is_NaN(f: f64) -> bool { f != f }
|
||||
@ -230,43 +230,43 @@ pub mod consts {
|
||||
// FIXME (requires Issue #1433 to fix): replace with mathematical
|
||||
// constants from cmath.
|
||||
/// Archimedes' constant
|
||||
pub const pi: f64 = 3.14159265358979323846264338327950288_f64;
|
||||
pub static pi: f64 = 3.14159265358979323846264338327950288_f64;
|
||||
|
||||
/// pi/2.0
|
||||
pub const frac_pi_2: f64 = 1.57079632679489661923132169163975144_f64;
|
||||
pub static frac_pi_2: f64 = 1.57079632679489661923132169163975144_f64;
|
||||
|
||||
/// pi/4.0
|
||||
pub const frac_pi_4: f64 = 0.785398163397448309615660845819875721_f64;
|
||||
pub static frac_pi_4: f64 = 0.785398163397448309615660845819875721_f64;
|
||||
|
||||
/// 1.0/pi
|
||||
pub const frac_1_pi: f64 = 0.318309886183790671537767526745028724_f64;
|
||||
pub static frac_1_pi: f64 = 0.318309886183790671537767526745028724_f64;
|
||||
|
||||
/// 2.0/pi
|
||||
pub const frac_2_pi: f64 = 0.636619772367581343075535053490057448_f64;
|
||||
pub static frac_2_pi: f64 = 0.636619772367581343075535053490057448_f64;
|
||||
|
||||
/// 2.0/sqrt(pi)
|
||||
pub const frac_2_sqrtpi: f64 = 1.12837916709551257389615890312154517_f64;
|
||||
pub static frac_2_sqrtpi: f64 = 1.12837916709551257389615890312154517_f64;
|
||||
|
||||
/// sqrt(2.0)
|
||||
pub const sqrt2: f64 = 1.41421356237309504880168872420969808_f64;
|
||||
pub static sqrt2: f64 = 1.41421356237309504880168872420969808_f64;
|
||||
|
||||
/// 1.0/sqrt(2.0)
|
||||
pub const frac_1_sqrt2: f64 = 0.707106781186547524400844362104849039_f64;
|
||||
pub static frac_1_sqrt2: f64 = 0.707106781186547524400844362104849039_f64;
|
||||
|
||||
/// Euler's number
|
||||
pub const e: f64 = 2.71828182845904523536028747135266250_f64;
|
||||
pub static e: f64 = 2.71828182845904523536028747135266250_f64;
|
||||
|
||||
/// log2(e)
|
||||
pub const log2_e: f64 = 1.44269504088896340735992468100189214_f64;
|
||||
pub static log2_e: f64 = 1.44269504088896340735992468100189214_f64;
|
||||
|
||||
/// log10(e)
|
||||
pub const log10_e: f64 = 0.434294481903251827651128918916605082_f64;
|
||||
pub static log10_e: f64 = 0.434294481903251827651128918916605082_f64;
|
||||
|
||||
/// ln(2.0)
|
||||
pub const ln_2: f64 = 0.693147180559945309417232121458176568_f64;
|
||||
pub static ln_2: f64 = 0.693147180559945309417232121458176568_f64;
|
||||
|
||||
/// ln(10.0)
|
||||
pub const ln_10: f64 = 2.30258509299404568401799145468436421_f64;
|
||||
pub static ln_10: f64 = 2.30258509299404568401799145468436421_f64;
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
@ -41,54 +41,54 @@ pub use f64::{modf, pow, round, sinh, tanh, tgamma, trunc};
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -21,11 +21,11 @@ use prelude::*;
|
||||
|
||||
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 }
|
||||
|
@ -14,7 +14,7 @@ use num::NumCast;
|
||||
|
||||
mod inst {
|
||||
pub type T = i16;
|
||||
pub const bits: uint = ::u16::bits;
|
||||
pub static bits: uint = ::u16::bits;
|
||||
}
|
||||
|
||||
impl NumCast for i16 {
|
||||
|
@ -14,7 +14,7 @@ use num::NumCast;
|
||||
|
||||
mod inst {
|
||||
pub type T = i32;
|
||||
pub const bits: uint = ::u32::bits;
|
||||
pub static bits: uint = ::u32::bits;
|
||||
}
|
||||
|
||||
impl NumCast for i32 {
|
||||
|
@ -14,7 +14,7 @@ use num::NumCast;
|
||||
|
||||
mod inst {
|
||||
pub type T = i64;
|
||||
pub const bits: uint = ::u64::bits;
|
||||
pub static bits: uint = ::u64::bits;
|
||||
}
|
||||
|
||||
impl NumCast for i64 {
|
||||
|
@ -14,7 +14,7 @@ use num::NumCast;
|
||||
|
||||
mod inst {
|
||||
pub type T = i8;
|
||||
pub const bits: uint = ::u8::bits;
|
||||
pub static bits: uint = ::u8::bits;
|
||||
}
|
||||
|
||||
impl NumCast for i8 {
|
||||
|
@ -16,7 +16,7 @@ pub use self::inst::pow;
|
||||
|
||||
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 {
|
||||
|
@ -394,9 +394,9 @@ pub fn to_str_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+
|
||||
|
||||
// Some constants for from_str_bytes_common's input validation,
|
||||
// they define minimum radix values for which the character is a valid digit.
|
||||
priv const DIGIT_P_RADIX: uint = ('p' as uint) - ('a' as uint) + 11u;
|
||||
priv const DIGIT_I_RADIX: uint = ('i' as uint) - ('a' as uint) + 11u;
|
||||
priv const DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
|
||||
priv static DIGIT_P_RADIX: uint = ('p' as uint) - ('a' as uint) + 11u;
|
||||
priv static DIGIT_I_RADIX: uint = ('i' as uint) - ('a' as uint) + 11u;
|
||||
priv static DIGIT_E_RADIX: uint = ('e' as uint) - ('a' as uint) + 11u;
|
||||
|
||||
/**
|
||||
* Parses a byte slice as a number. This is meant to
|
||||
|
@ -23,11 +23,11 @@ use prelude::*;
|
||||
|
||||
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 }
|
||||
|
@ -16,7 +16,7 @@ mod inst {
|
||||
pub type T = u16;
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type T_SIGNED = i16;
|
||||
pub const bits: uint = 16;
|
||||
pub static bits: uint = 16;
|
||||
}
|
||||
|
||||
impl NumCast for u16 {
|
||||
|
@ -16,7 +16,7 @@ mod inst {
|
||||
pub type T = u32;
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type T_SIGNED = i32;
|
||||
pub const bits: uint = 32;
|
||||
pub static bits: uint = 32;
|
||||
}
|
||||
|
||||
impl NumCast for u32 {
|
||||
|
@ -16,7 +16,7 @@ mod inst {
|
||||
pub type T = u64;
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type T_SIGNED = i64;
|
||||
pub const bits: uint = 64;
|
||||
pub static bits: uint = 64;
|
||||
}
|
||||
|
||||
impl NumCast for u64 {
|
||||
|
@ -18,7 +18,7 @@ mod inst {
|
||||
pub type T = u8;
|
||||
#[allow(non_camel_case_types)]
|
||||
pub type T_SIGNED = i8;
|
||||
pub const bits: uint = 8;
|
||||
pub static bits: uint = 8;
|
||||
|
||||
// Type-specific functions here. These must be reexported by the
|
||||
// parent module so that they appear in core::u8 and not core::u8::u8;
|
||||
|
@ -28,10 +28,10 @@ pub mod inst {
|
||||
#[cfg(target_arch = "x86")]
|
||||
#[cfg(target_arch = "arm")]
|
||||
#[cfg(target_arch = "mips")]
|
||||
pub const bits: uint = 32;
|
||||
pub static bits: uint = 32;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub const bits: uint = 64;
|
||||
pub static bits: uint = 64;
|
||||
|
||||
/**
|
||||
* Divide two numbers, return the result, rounded up.
|
||||
|
@ -65,8 +65,8 @@ pub mod rustrt {
|
||||
}
|
||||
}
|
||||
|
||||
pub const TMPBUF_SZ : uint = 1000u;
|
||||
const BUF_BYTES : uint = 2048u;
|
||||
pub static TMPBUF_SZ : uint = 1000u;
|
||||
static BUF_BYTES : uint = 2048u;
|
||||
|
||||
pub fn getcwd() -> Path {
|
||||
let buf = [0 as libc::c_char, ..BUF_BYTES];
|
||||
@ -1013,8 +1013,8 @@ pub fn last_os_error() -> ~str {
|
||||
args: *c_void) -> DWORD;
|
||||
}
|
||||
|
||||
const FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000;
|
||||
const FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200;
|
||||
static FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000;
|
||||
static FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200;
|
||||
|
||||
let mut buf = [0 as c_char, ..TMPBUF_SZ];
|
||||
|
||||
@ -1170,11 +1170,11 @@ pub mod consts {
|
||||
pub use os::consts::windows::*;
|
||||
|
||||
pub mod unix {
|
||||
pub const FAMILY: &'static str = "unix";
|
||||
pub static FAMILY: &'static str = "unix";
|
||||
}
|
||||
|
||||
pub mod windows {
|
||||
pub const FAMILY: &'static str = "windows";
|
||||
pub static FAMILY: &'static str = "windows";
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
@ -1193,38 +1193,38 @@ pub mod consts {
|
||||
pub use os::consts::win32::*;
|
||||
|
||||
pub mod macos {
|
||||
pub const SYSNAME: &'static str = "macos";
|
||||
pub const DLL_PREFIX: &'static str = "lib";
|
||||
pub const DLL_SUFFIX: &'static str = ".dylib";
|
||||
pub const EXE_SUFFIX: &'static str = "";
|
||||
pub static SYSNAME: &'static str = "macos";
|
||||
pub static DLL_PREFIX: &'static str = "lib";
|
||||
pub static DLL_SUFFIX: &'static str = ".dylib";
|
||||
pub static EXE_SUFFIX: &'static str = "";
|
||||
}
|
||||
|
||||
pub mod freebsd {
|
||||
pub const SYSNAME: &'static str = "freebsd";
|
||||
pub const DLL_PREFIX: &'static str = "lib";
|
||||
pub const DLL_SUFFIX: &'static str = ".so";
|
||||
pub const EXE_SUFFIX: &'static str = "";
|
||||
pub static SYSNAME: &'static str = "freebsd";
|
||||
pub static DLL_PREFIX: &'static str = "lib";
|
||||
pub static DLL_SUFFIX: &'static str = ".so";
|
||||
pub static EXE_SUFFIX: &'static str = "";
|
||||
}
|
||||
|
||||
pub mod linux {
|
||||
pub const SYSNAME: &'static str = "linux";
|
||||
pub const DLL_PREFIX: &'static str = "lib";
|
||||
pub const DLL_SUFFIX: &'static str = ".so";
|
||||
pub const EXE_SUFFIX: &'static str = "";
|
||||
pub static SYSNAME: &'static str = "linux";
|
||||
pub static DLL_PREFIX: &'static str = "lib";
|
||||
pub static DLL_SUFFIX: &'static str = ".so";
|
||||
pub static EXE_SUFFIX: &'static str = "";
|
||||
}
|
||||
|
||||
pub mod android {
|
||||
pub const SYSNAME: &'static str = "android";
|
||||
pub const DLL_PREFIX: &'static str = "lib";
|
||||
pub const DLL_SUFFIX: &'static str = ".so";
|
||||
pub const EXE_SUFFIX: &'static str = "";
|
||||
pub static SYSNAME: &'static str = "android";
|
||||
pub static DLL_PREFIX: &'static str = "lib";
|
||||
pub static DLL_SUFFIX: &'static str = ".so";
|
||||
pub static EXE_SUFFIX: &'static str = "";
|
||||
}
|
||||
|
||||
pub mod win32 {
|
||||
pub const SYSNAME: &'static str = "win32";
|
||||
pub const DLL_PREFIX: &'static str = "";
|
||||
pub const DLL_SUFFIX: &'static str = ".dll";
|
||||
pub const EXE_SUFFIX: &'static str = ".exe";
|
||||
pub static SYSNAME: &'static str = "win32";
|
||||
pub static DLL_PREFIX: &'static str = "";
|
||||
pub static DLL_SUFFIX: &'static str = ".dll";
|
||||
pub static EXE_SUFFIX: &'static str = ".exe";
|
||||
}
|
||||
|
||||
|
||||
@ -1241,16 +1241,16 @@ pub mod consts {
|
||||
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";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ use task;
|
||||
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 } )
|
||||
|
@ -313,7 +313,7 @@ impl RngUtil for @Rng {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -112,10 +112,10 @@ fn initialize_call_frame(regs: &mut Registers,
|
||||
fptr: *c_void, arg: *c_void, sp: *mut uint) {
|
||||
|
||||
// Redefinitions from regs.h
|
||||
const RUSTRT_ARG0: uint = 3;
|
||||
const RUSTRT_RSP: uint = 1;
|
||||
const RUSTRT_IP: uint = 8;
|
||||
const RUSTRT_RBP: uint = 2;
|
||||
static RUSTRT_ARG0: uint = 3;
|
||||
static RUSTRT_RSP: uint = 1;
|
||||
static RUSTRT_IP: uint = 8;
|
||||
static RUSTRT_RBP: uint = 2;
|
||||
|
||||
let sp = align_down(sp);
|
||||
let sp = mut_offset(sp, -1);
|
||||
|
@ -282,7 +282,7 @@ pub impl Scheduler {
|
||||
}
|
||||
}
|
||||
|
||||
const TASK_MIN_STACK_SIZE: uint = 10000000; // XXX: Too much stack
|
||||
static TASK_MIN_STACK_SIZE: uint = 10000000; // XXX: Too much stack
|
||||
|
||||
pub struct Task {
|
||||
/// The task entry point, saved here for later destruction
|
||||
@ -481,7 +481,7 @@ fn test_swap_tasks() {
|
||||
#[bench] #[test] #[ignore(reason = "long test")]
|
||||
fn test_run_a_lot_of_tasks_queued() {
|
||||
do run_in_bare_thread {
|
||||
const MAX: int = 1000000;
|
||||
static MAX: int = 1000000;
|
||||
let mut count = 0;
|
||||
let count_ptr: *mut int = &mut count;
|
||||
|
||||
@ -514,7 +514,7 @@ fn test_run_a_lot_of_tasks_queued() {
|
||||
#[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;
|
||||
|
||||
|
@ -56,7 +56,7 @@ pub type Key = DWORD;
|
||||
|
||||
#[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);
|
||||
}
|
||||
|
@ -396,7 +396,7 @@ pub impl TcpWatcher {
|
||||
data.connect_cb = Some(cb);
|
||||
|
||||
unsafe {
|
||||
const BACKLOG: c_int = 128; // XXX should be configurable
|
||||
static BACKLOG: c_int = 128; // XXX should be configurable
|
||||
// XXX: This can probably fail
|
||||
fail_unless!(0 == uvll::listen(self.native_handle(),
|
||||
BACKLOG, connection_cb));
|
||||
@ -848,7 +848,7 @@ fn connect_read() {
|
||||
#[ignore(reason = "ffi struct issues")]
|
||||
fn listen() {
|
||||
do run_in_bare_thread() {
|
||||
const MAX: int = 10;
|
||||
static MAX: int = 10;
|
||||
let mut loop_ = Loop::new();
|
||||
let mut server_tcp_watcher = { TcpWatcher::new(&mut loop_) };
|
||||
let addr = Ipv4(127, 0, 0, 1, 2925);
|
||||
|
@ -1907,26 +1907,26 @@ pub fn any_between(s: &str, start: uint, end: uint,
|
||||
}
|
||||
|
||||
// UTF-8 tags and ranges
|
||||
const tag_cont_u8: u8 = 128u8;
|
||||
const tag_cont: uint = 128u;
|
||||
const max_one_b: uint = 128u;
|
||||
const tag_two_b: uint = 192u;
|
||||
const max_two_b: uint = 2048u;
|
||||
const tag_three_b: uint = 224u;
|
||||
const max_three_b: uint = 65536u;
|
||||
const tag_four_b: uint = 240u;
|
||||
const max_four_b: uint = 2097152u;
|
||||
const tag_five_b: uint = 248u;
|
||||
const max_five_b: uint = 67108864u;
|
||||
const tag_six_b: uint = 252u;
|
||||
static tag_cont_u8: u8 = 128u8;
|
||||
static tag_cont: uint = 128u;
|
||||
static max_one_b: uint = 128u;
|
||||
static tag_two_b: uint = 192u;
|
||||
static max_two_b: uint = 2048u;
|
||||
static tag_three_b: uint = 224u;
|
||||
static max_three_b: uint = 65536u;
|
||||
static tag_four_b: uint = 240u;
|
||||
static max_four_b: uint = 2097152u;
|
||||
static tag_five_b: uint = 248u;
|
||||
static max_five_b: uint = 67108864u;
|
||||
static tag_six_b: uint = 252u;
|
||||
|
||||
// Constants used for converting strs to floats
|
||||
pub const inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
|
||||
pub const positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8,
|
||||
'n' as u8, 'f' as u8];
|
||||
pub const negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8,
|
||||
'n' as u8, 'f' as u8];
|
||||
pub const nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
|
||||
pub static inf_buf: [u8*3] = ['i' as u8, 'n' as u8, 'f' as u8];
|
||||
pub static positive_inf_buf: [u8*4] = ['+' as u8, 'i' as u8,
|
||||
'n' as u8, 'f' as u8];
|
||||
pub static negative_inf_buf: [u8*4] = ['-' as u8, 'i' as u8,
|
||||
'n' as u8, 'f' as u8];
|
||||
pub static nan_buf: [u8*3] = ['N' as u8, 'a' as u8, 'N' as u8];
|
||||
|
||||
/**
|
||||
* Work with the byte buffer of a string.
|
||||
|
@ -1160,7 +1160,7 @@ fn test_child_doesnt_ref_parent() {
|
||||
// climbing the task tree to dereference each ancestor. (See #1789)
|
||||
// (well, it would if the constant were 8000+ - I lowered it to be more
|
||||
// valgrind-friendly. try this at home, instead..!)
|
||||
const generations: uint = 16;
|
||||
static generations: uint = 16;
|
||||
fn child_no(x: uint) -> ~fn() {
|
||||
return || {
|
||||
if x < generations {
|
||||
|
@ -13,9 +13,9 @@
|
||||
use prelude::*;
|
||||
|
||||
// FIXME: #5244: need to manually update the TrieNode constructor
|
||||
const SHIFT: uint = 4;
|
||||
const SIZE: uint = 1 << SHIFT;
|
||||
const MASK: uint = SIZE - 1;
|
||||
static SHIFT: uint = 4;
|
||||
static SIZE: uint = 1 << SHIFT;
|
||||
static MASK: uint = SIZE - 1;
|
||||
|
||||
enum Child<T> {
|
||||
Internal(~TrieNode<T>),
|
||||
|
@ -687,12 +687,12 @@ pub mod rt {
|
||||
use uint;
|
||||
use vec;
|
||||
|
||||
pub const flag_none : u32 = 0u32;
|
||||
pub const flag_left_justify : u32 = 0b00000000000001u32;
|
||||
pub const flag_left_zero_pad : u32 = 0b00000000000010u32;
|
||||
pub const flag_space_for_sign : u32 = 0b00000000000100u32;
|
||||
pub const flag_sign_always : u32 = 0b00000000001000u32;
|
||||
pub const flag_alternate : u32 = 0b00000000010000u32;
|
||||
pub static flag_none : u32 = 0u32;
|
||||
pub static flag_left_justify : u32 = 0b00000000000001u32;
|
||||
pub static flag_left_zero_pad : u32 = 0b00000000000010u32;
|
||||
pub static flag_space_for_sign : u32 = 0b00000000000100u32;
|
||||
pub static flag_sign_always : u32 = 0b00000000001000u32;
|
||||
pub static flag_alternate : u32 = 0b00000000010000u32;
|
||||
|
||||
pub enum Count { CountIs(uint), CountImplied, }
|
||||
|
||||
|
@ -159,7 +159,7 @@ impl Drop for GlobalState {
|
||||
|
||||
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
|
||||
|
@ -22,9 +22,9 @@ use cast::transmute;
|
||||
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};
|
||||
|
@ -26,8 +26,8 @@ fn choice<T:copy>(r : rand::rng, v : ~[const T]) -> T {
|
||||
fn likelihood(r : rand::rng, k : uint, n : uint) -> bool { under(r, n) < k }
|
||||
|
||||
|
||||
const iters : uint = 1000u;
|
||||
const vlen : uint = 100u;
|
||||
static iters : uint = 1000u;
|
||||
static vlen : uint = 100u;
|
||||
|
||||
enum maybe_pointy {
|
||||
none,
|
||||
|
@ -54,7 +54,7 @@ struct Command {
|
||||
usage_full: UsageSource/&self
|
||||
}
|
||||
|
||||
const commands: &'static [Command/&static] = &[
|
||||
static commands: &'static [Command/&static] = &[
|
||||
Command{
|
||||
cmd: "build",
|
||||
action: Exec("rustc"),
|
||||
@ -199,7 +199,7 @@ fn do_command(command: &Command, args: &[~str]) -> ValidUsage {
|
||||
}
|
||||
|
||||
fn usage() {
|
||||
const indent: uint = 8;
|
||||
static indent: uint = 8;
|
||||
|
||||
io::print(
|
||||
"The rust tool is a convenience for managing rust source code.\n\
|
||||
|
@ -11,64 +11,64 @@
|
||||
|
||||
|
||||
|
||||
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"; }
|
||||
|
||||
|
@ -44,29 +44,29 @@ pub struct config {
|
||||
float_type: float_ty
|
||||
}
|
||||
|
||||
pub const verbose: uint = 1 << 0;
|
||||
pub const time_passes: uint = 1 << 1;
|
||||
pub const count_llvm_insns: uint = 1 << 2;
|
||||
pub const time_llvm_passes: uint = 1 << 3;
|
||||
pub const trans_stats: uint = 1 << 4;
|
||||
pub const no_asm_comments: uint = 1 << 5;
|
||||
pub const no_verify: uint = 1 << 6;
|
||||
pub const trace: uint = 1 << 7;
|
||||
pub const coherence: uint = 1 << 8;
|
||||
pub const borrowck_stats: uint = 1 << 9;
|
||||
pub const borrowck_note_pure: uint = 1 << 10;
|
||||
pub const borrowck_note_loan: uint = 1 << 11;
|
||||
pub const no_landing_pads: uint = 1 << 12;
|
||||
pub const debug_llvm: uint = 1 << 13;
|
||||
pub const count_type_sizes: uint = 1 << 14;
|
||||
pub const meta_stats: uint = 1 << 15;
|
||||
pub const no_opt: uint = 1 << 16;
|
||||
pub const no_monomorphic_collapse: uint = 1 << 17;
|
||||
pub const gc: uint = 1 << 18;
|
||||
pub const jit: uint = 1 << 19;
|
||||
pub const debug_info: uint = 1 << 20;
|
||||
pub const extra_debug_info: uint = 1 << 21;
|
||||
pub const static: uint = 1 << 22;
|
||||
pub static verbose: uint = 1 << 0;
|
||||
pub static time_passes: uint = 1 << 1;
|
||||
pub static count_llvm_insns: uint = 1 << 2;
|
||||
pub static time_llvm_passes: uint = 1 << 3;
|
||||
pub static trans_stats: uint = 1 << 4;
|
||||
pub static no_asm_comments: uint = 1 << 5;
|
||||
pub static no_verify: uint = 1 << 6;
|
||||
pub static trace: uint = 1 << 7;
|
||||
pub static coherence: uint = 1 << 8;
|
||||
pub static borrowck_stats: uint = 1 << 9;
|
||||
pub static borrowck_note_pure: uint = 1 << 10;
|
||||
pub static borrowck_note_loan: uint = 1 << 11;
|
||||
pub static no_landing_pads: uint = 1 << 12;
|
||||
pub static debug_llvm: uint = 1 << 13;
|
||||
pub static count_type_sizes: uint = 1 << 14;
|
||||
pub static meta_stats: uint = 1 << 15;
|
||||
pub static no_opt: uint = 1 << 16;
|
||||
pub static no_monomorphic_collapse: uint = 1 << 17;
|
||||
pub static gc: uint = 1 << 18;
|
||||
pub static jit: uint = 1 << 19;
|
||||
pub static debug_info: uint = 1 << 20;
|
||||
pub static extra_debug_info: uint = 1 << 21;
|
||||
pub static static: uint = 1 << 22;
|
||||
|
||||
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
|
||||
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
|
||||
|
@ -19,7 +19,7 @@ use syntax::codemap;
|
||||
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 {
|
||||
|
@ -257,7 +257,7 @@ mod __test {
|
||||
std::test::test_main_static(::os::args(), tests)
|
||||
}
|
||||
|
||||
const tests : &'static [std::test::TestDescAndFn] = &[
|
||||
static tests : &'static [std::test::TestDescAndFn] = &[
|
||||
... the list of tests in the crate ...
|
||||
];
|
||||
}
|
||||
@ -360,7 +360,7 @@ fn mk_tests(cx: &TestCtxt) -> @ast::item {
|
||||
let test_descs = mk_test_descs(cx);
|
||||
|
||||
(quote_item!(
|
||||
pub const tests : &'static [self::std::test::TestDescAndFn] =
|
||||
pub static tests : &'static [self::std::test::TestDescAndFn] =
|
||||
$test_descs
|
||||
;
|
||||
)).get()
|
||||
|
@ -20,8 +20,8 @@ use std::oldmap::HashMap;
|
||||
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.
|
||||
|
||||
|
@ -11,84 +11,84 @@
|
||||
|
||||
// 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 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 const tag_region_param: uint = 0x46u;
|
||||
pub const tag_mod_impl_trait: uint = 0x47u;
|
||||
pub static tag_region_param: uint = 0x46u;
|
||||
pub static tag_mod_impl_trait: uint = 0x47u;
|
||||
/*
|
||||
trait items contain tag_item_trait_method elements,
|
||||
impl items contain tag_item_impl_method elements, and classes
|
||||
@ -97,16 +97,16 @@ pub const tag_mod_impl_trait: uint = 0x47u;
|
||||
both, tag_item_trait_method and tag_item_impl_method have to be two
|
||||
different tags.
|
||||
*/
|
||||
pub const tag_item_impl_method: uint = 0x48u;
|
||||
pub const tag_item_dtor: uint = 0x49u;
|
||||
pub const tag_item_trait_method_self_ty: uint = 0x4b;
|
||||
pub const tag_item_trait_method_self_ty_region: uint = 0x4c;
|
||||
pub static tag_item_impl_method: uint = 0x48u;
|
||||
pub static tag_item_dtor: uint = 0x49u;
|
||||
pub static tag_item_trait_method_self_ty: uint = 0x4b;
|
||||
pub static tag_item_trait_method_self_ty_region: uint = 0x4c;
|
||||
|
||||
// Reexports are found within module tags. Each reexport contains def_ids
|
||||
// and names.
|
||||
pub const tag_items_data_item_reexport: uint = 0x4d;
|
||||
pub const tag_items_data_item_reexport_def_id: uint = 0x4e;
|
||||
pub const tag_items_data_item_reexport_name: uint = 0x4f;
|
||||
pub static tag_items_data_item_reexport: uint = 0x4d;
|
||||
pub static tag_items_data_item_reexport_def_id: uint = 0x4e;
|
||||
pub static tag_items_data_item_reexport_name: uint = 0x4f;
|
||||
|
||||
// used to encode crate_ctxt side tables
|
||||
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
|
||||
@ -136,9 +136,9 @@ pub enum astencode_tag { // Reserves 0x50 -- 0x6f
|
||||
tag_table_capture_map = 0x64
|
||||
}
|
||||
|
||||
pub const tag_item_trait_method_sort: uint = 0x70;
|
||||
pub static tag_item_trait_method_sort: uint = 0x70;
|
||||
|
||||
pub const tag_item_impl_type_basename: uint = 0x71;
|
||||
pub static tag_item_impl_type_basename: uint = 0x71;
|
||||
|
||||
// Language items are a top-level directory (for speed). Hierarchy:
|
||||
//
|
||||
@ -147,17 +147,17 @@ pub const tag_item_impl_type_basename: uint = 0x71;
|
||||
// - 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,
|
||||
|
@ -1313,7 +1313,7 @@ fn encode_hash(ebml_w: writer::Encoder, hash: &str) {
|
||||
}
|
||||
|
||||
// NB: Increment this as you change the metadata encoding version.
|
||||
pub const metadata_encoding_version : &'static [u8] =
|
||||
pub static metadata_encoding_version : &'static [u8] =
|
||||
&[0x72, //'r' as u8,
|
||||
0x75, //'u' as u8,
|
||||
0x73, //'s' as u8,
|
||||
|
@ -58,7 +58,7 @@ use syntax::{visit, ast_util};
|
||||
|
||||
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, ()>;
|
||||
|
||||
|
@ -653,9 +653,9 @@ struct Specials {
|
||||
no_ret_var: Variable
|
||||
}
|
||||
|
||||
const ACC_READ: uint = 1u;
|
||||
const ACC_WRITE: uint = 2u;
|
||||
const ACC_USE: uint = 4u;
|
||||
static ACC_READ: uint = 1u;
|
||||
static ACC_WRITE: uint = 2u;
|
||||
static ACC_USE: uint = 4u;
|
||||
|
||||
type LiveNodeMap = HashMap<node_id, LiveNode>;
|
||||
|
||||
|
@ -178,7 +178,7 @@ pub fn IndirectBr(cx: block, Addr: ValueRef, NumDests: uint) {
|
||||
// lot more efficient) than doing str::as_c_str("", ...) every time.
|
||||
pub fn noname() -> *libc::c_char {
|
||||
unsafe {
|
||||
const cnull: uint = 0u;
|
||||
static cnull: uint = 0u;
|
||||
return cast::reinterpret_cast(&ptr::addr_of(&cnull));
|
||||
}
|
||||
}
|
||||
|
@ -76,8 +76,8 @@ pub type addrspace = c_uint;
|
||||
// 0 is ignored by the GC, and is used for all non-GC'd pointers.
|
||||
// 1 is for opaque GC'd boxes.
|
||||
// >= 2 are for specific types (e.g. resources).
|
||||
pub const default_addrspace: addrspace = 0;
|
||||
pub const gc_box_addrspace: addrspace = 1;
|
||||
pub static default_addrspace: addrspace = 0;
|
||||
pub static gc_box_addrspace: addrspace = 1;
|
||||
|
||||
pub type addrspace_gen = @fn() -> addrspace;
|
||||
pub fn new_addrspace_gen() -> addrspace_gen {
|
||||
@ -615,7 +615,7 @@ pub fn mk_block(llbb: BasicBlockRef, parent: Option<block>, +kind: block_kind,
|
||||
}
|
||||
|
||||
// First two args are retptr, env
|
||||
pub const first_real_arg: uint = 2u;
|
||||
pub static first_real_arg: uint = 2u;
|
||||
|
||||
pub struct Result {
|
||||
bcx: block,
|
||||
|
@ -179,7 +179,7 @@ pub fn const_expr(cx: @CrateContext, e: @ast::expr) -> ValueRef {
|
||||
llconst = C_struct(~[llconst, C_null(T_opaque_box_ptr(cx))])
|
||||
}
|
||||
Some(@ty::AutoAddEnv(ref r, ref s)) => {
|
||||
cx.sess.span_bug(e.span, fmt!("unexpected const function: \
|
||||
cx.sess.span_bug(e.span, fmt!("unexpected static function: \
|
||||
region %? sigil %?", *r, *s))
|
||||
}
|
||||
Some(@ty::AutoDerefRef(ref adj)) => {
|
||||
|
@ -29,32 +29,32 @@ use syntax::codemap::{span, CharPos};
|
||||
use syntax::parse::token::ident_interner;
|
||||
use syntax::{ast, codemap, ast_util, ast_map};
|
||||
|
||||
const LLVMDebugVersion: int = (9 << 16);
|
||||
static LLVMDebugVersion: int = (9 << 16);
|
||||
|
||||
const DW_LANG_RUST: int = 0x9000;
|
||||
const DW_VIRTUALITY_none: int = 0;
|
||||
static DW_LANG_RUST: int = 0x9000;
|
||||
static 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;
|
||||
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;
|
||||
|
||||
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 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| {
|
||||
|
@ -47,9 +47,9 @@ use syntax::ast_util;
|
||||
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,
|
||||
|
@ -1801,43 +1801,43 @@ impl ToStr for TypeContents {
|
||||
}
|
||||
|
||||
/// Constant for a type containing nothing of interest.
|
||||
const TC_NONE: TypeContents = TypeContents{bits:0b0000_00000000};
|
||||
static TC_NONE: TypeContents = TypeContents{bits:0b0000_00000000};
|
||||
|
||||
/// Contains a borrowed value with a lifetime other than static
|
||||
const TC_BORROWED_POINTER: TypeContents = TypeContents{bits:0b0000_00000001};
|
||||
static TC_BORROWED_POINTER: TypeContents = TypeContents{bits:0b0000_00000001};
|
||||
|
||||
/// Contains an owned pointer (~T) but not slice of some kind
|
||||
const TC_OWNED_POINTER: TypeContents = TypeContents{bits:0b000000000010};
|
||||
static TC_OWNED_POINTER: TypeContents = TypeContents{bits:0b000000000010};
|
||||
|
||||
/// Contains an owned vector ~[] or owned string ~str
|
||||
const TC_OWNED_VEC: TypeContents = TypeContents{bits:0b000000000100};
|
||||
static TC_OWNED_VEC: TypeContents = TypeContents{bits:0b000000000100};
|
||||
|
||||
/// Contains a ~fn() or a ~Trait, which is non-copyable.
|
||||
const TC_OWNED_CLOSURE: TypeContents = TypeContents{bits:0b000000001000};
|
||||
static TC_OWNED_CLOSURE: TypeContents = TypeContents{bits:0b000000001000};
|
||||
|
||||
/// Type with a destructor
|
||||
const TC_DTOR: TypeContents = TypeContents{bits:0b000000010000};
|
||||
static TC_DTOR: TypeContents = TypeContents{bits:0b000000010000};
|
||||
|
||||
/// Contains a managed value
|
||||
const TC_MANAGED: TypeContents = TypeContents{bits:0b000000100000};
|
||||
static TC_MANAGED: TypeContents = TypeContents{bits:0b000000100000};
|
||||
|
||||
/// &mut with any region
|
||||
const TC_BORROWED_MUT: TypeContents = TypeContents{bits:0b000001000000};
|
||||
static TC_BORROWED_MUT: TypeContents = TypeContents{bits:0b000001000000};
|
||||
|
||||
/// Mutable content, whether owned or by ref
|
||||
const TC_MUTABLE: TypeContents = TypeContents{bits:0b000010000000};
|
||||
static TC_MUTABLE: TypeContents = TypeContents{bits:0b000010000000};
|
||||
|
||||
/// Mutable content, whether owned or by ref
|
||||
const TC_ONCE_CLOSURE: TypeContents = TypeContents{bits:0b000100000000};
|
||||
static TC_ONCE_CLOSURE: TypeContents = TypeContents{bits:0b000100000000};
|
||||
|
||||
/// Something we estimate to be "big"
|
||||
const TC_BIG: TypeContents = TypeContents{bits:0b001000000000};
|
||||
static TC_BIG: TypeContents = TypeContents{bits:0b001000000000};
|
||||
|
||||
/// An enum with no variants.
|
||||
const TC_EMPTY_ENUM: TypeContents = TypeContents{bits:0b010000000000};
|
||||
static TC_EMPTY_ENUM: TypeContents = TypeContents{bits:0b010000000000};
|
||||
|
||||
/// All possible contents.
|
||||
const TC_ALL: TypeContents = TypeContents{bits:0b011111111111};
|
||||
static TC_ALL: TypeContents = TypeContents{bits:0b011111111111};
|
||||
|
||||
pub fn type_is_copyable(cx: ctxt, t: ty::t) -> bool {
|
||||
type_contents(cx, t).is_copy(cx)
|
||||
@ -4076,21 +4076,21 @@ fn struct_item_fields(cx:ctxt,
|
||||
}
|
||||
|
||||
pub fn is_binopable(_cx: ctxt, ty: t, op: ast::binop) -> bool {
|
||||
const tycat_other: int = 0;
|
||||
const tycat_bool: int = 1;
|
||||
const tycat_int: int = 2;
|
||||
const tycat_float: int = 3;
|
||||
const tycat_struct: int = 4;
|
||||
const tycat_bot: int = 5;
|
||||
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;
|
||||
|
||||
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 opcat_add: int = 0;
|
||||
static opcat_sub: int = 1;
|
||||
static opcat_mult: int = 2;
|
||||
static opcat_shift: int = 3;
|
||||
static opcat_rel: int = 4;
|
||||
static opcat_eq: int = 5;
|
||||
static opcat_bit: int = 6;
|
||||
static opcat_logic: int = 7;
|
||||
|
||||
fn opcat(op: ast::binop) -> int {
|
||||
match op {
|
||||
@ -4126,8 +4126,8 @@ pub fn is_binopable(_cx: ctxt, ty: t, op: ast::binop) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
const t: bool = true;
|
||||
const f: bool = false;
|
||||
static t: bool = true;
|
||||
static f: bool = false;
|
||||
|
||||
let tbl = ~[
|
||||
/*. add, shift, bit
|
||||
|
@ -202,8 +202,8 @@ pub fn ast_path_to_ty<AC:AstConv,RS:region_scope + Copy + Durable>(
|
||||
ty_param_substs_and_ty { substs: substs, ty: ty }
|
||||
}
|
||||
|
||||
pub const NO_REGIONS: uint = 1;
|
||||
pub const NO_TPS: uint = 2;
|
||||
pub static NO_REGIONS: uint = 1;
|
||||
pub static NO_TPS: uint = 2;
|
||||
|
||||
// Parses the programmer's textual representation of a type into our
|
||||
// internal notion of a type. `getter` is a function that returns the type
|
||||
|
@ -62,23 +62,23 @@ use syntax::ast;
|
||||
|
||||
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 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 const not_regions: uint = !(force_rvar | resolve_rvar);
|
||||
pub static 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 try_resolve_tvar_shallow: uint = 0;
|
||||
pub static resolve_and_force_all_but_regions: uint =
|
||||
(resolve_all | force_all) & not_regions;
|
||||
|
||||
pub struct ResolveState {
|
||||
|
@ -47,7 +47,7 @@ struct RH {
|
||||
sub: &[RH]
|
||||
}
|
||||
|
||||
const EMPTY_SOURCE_STR: &str = "/* Hello, world! */";
|
||||
static EMPTY_SOURCE_STR: &str = "/* Hello, world! */";
|
||||
|
||||
fn setup_env(test_name: &str, source_string: &str) -> Env {
|
||||
let messages = @DVec();
|
||||
|
@ -24,7 +24,7 @@
|
||||
use core::prelude::*;
|
||||
|
||||
/// The base price of a muffin on a non-holiday
|
||||
const price_of_a_muffin: float = 70f;
|
||||
static price_of_a_muffin: float = 70f;
|
||||
|
||||
struct WaitPerson {
|
||||
hair_color: ~str
|
||||
|
@ -127,8 +127,7 @@ fn extract(desc: Option<~str>) -> Option<~str> {
|
||||
}
|
||||
|
||||
fn parse_desc(desc: ~str) -> Option<~str> {
|
||||
|
||||
const max_brief_len: uint = 120u;
|
||||
static max_brief_len: uint = 120u;
|
||||
|
||||
match first_sentence(copy desc) {
|
||||
Some(first_sentence) => {
|
||||
|
@ -184,7 +184,7 @@ fn constdoc_from_const(itemdoc: doc::ItemDoc) -> doc::ConstDoc {
|
||||
|
||||
#[test]
|
||||
fn should_extract_const_name_and_id() {
|
||||
let doc = test::mk_doc(~"const a: int = 0;");
|
||||
let doc = test::mk_doc(~"static a: int = 0;");
|
||||
fail_unless!(doc.cratemod().consts()[0].id() != 0);
|
||||
fail_unless!(doc.cratemod().consts()[0].name() == ~"a");
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ fn default_fold_should_produce_same_doc() {
|
||||
|
||||
#[test]
|
||||
fn default_fold_should_produce_same_consts() {
|
||||
let source = ~"const a: int = 0;";
|
||||
let source = ~"static a: int = 0;";
|
||||
let ast = parse::from_str(source);
|
||||
let doc = extract::extract(ast, ~"");
|
||||
let fld = default_seq_fold(());
|
||||
|
@ -594,7 +594,7 @@ fn write_const(
|
||||
|
||||
#[test]
|
||||
fn should_write_const_header() {
|
||||
let markdown = test::render(~"const a: bool = true;");
|
||||
let markdown = test::render(~"static a: bool = true;");
|
||||
fail_unless!(str::contains(markdown, ~"## Const `a`\n\n"));
|
||||
}
|
||||
|
||||
@ -602,7 +602,7 @@ fn should_write_const_header() {
|
||||
fn should_write_const_description() {
|
||||
let markdown = test::render(
|
||||
~"#[doc = \"b\"]\
|
||||
const a: bool = true;");
|
||||
static a: bool = true;");
|
||||
fail_unless!(str::contains(markdown, ~"\n\nb\n\n"));
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ fn test() {
|
||||
~"mod imod { } \
|
||||
extern mod inmod {
|
||||
} \
|
||||
const iconst: int = 0; \
|
||||
static iconst: int = 0; \
|
||||
fn ifn() { } \
|
||||
enum ienum { ivar } \
|
||||
trait itrait { fn a(); } \
|
||||
|
@ -121,7 +121,7 @@ fn fold_const(
|
||||
|
||||
#[test]
|
||||
fn should_add_const_types() {
|
||||
let doc = test::mk_doc(~"const a: bool = true;");
|
||||
let doc = test::mk_doc(~"static a: bool = true;");
|
||||
fail_unless!(doc.cratemod().consts()[0].sig == Some(~"bool"));
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ fn add_pkg_module(ctx: @mut ReadyCtx, m: ast::_mod) -> ast::_mod {
|
||||
let item = quote_item! (
|
||||
mod __pkg {
|
||||
extern mod rustpkg (vers="0.6");
|
||||
const listeners : &[rustpkg::Listener] = $listeners;
|
||||
static listeners : &[rustpkg::Listener] = $listeners;
|
||||
#[main]
|
||||
fn main() {
|
||||
rustpkg::run(listeners);
|
||||
|
@ -68,7 +68,7 @@ pub mod rustrt {
|
||||
|
||||
// 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
|
||||
|
@ -44,14 +44,14 @@ pub mod BigDigit {
|
||||
#[cfg(target_arch = "x86")]
|
||||
#[cfg(target_arch = "arm")]
|
||||
#[cfg(target_arch = "mips")]
|
||||
pub const bits: uint = 16;
|
||||
pub static bits: uint = 16;
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
pub const bits: uint = 32;
|
||||
pub static bits: uint = 32;
|
||||
|
||||
pub const base: uint = 1 << bits;
|
||||
priv const hi_mask: uint = (-1 as uint) << bits;
|
||||
priv const lo_mask: uint = (-1 as uint) >> bits;
|
||||
pub static base: uint = 1 << bits;
|
||||
priv static hi_mask: uint = (-1 as uint) << bits;
|
||||
priv static lo_mask: uint = (-1 as uint) >> bits;
|
||||
|
||||
priv fn get_hi(n: uint) -> BigDigit { (n >> bits) as BigDigit }
|
||||
priv fn get_lo(n: uint) -> BigDigit { (n & lo_mask) as BigDigit }
|
||||
@ -1046,9 +1046,9 @@ mod biguint_tests {
|
||||
fail_unless!(BigUint::new(~[0, 0, -1]).to_uint() == uint::max_value);
|
||||
}
|
||||
|
||||
const sum_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
static sum_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
(&[], &[], &[]),
|
||||
(&[], &[ 1], &[ 1]),
|
||||
(&[ 1], &[ 1], &[ 2]),
|
||||
@ -1086,9 +1086,9 @@ mod biguint_tests {
|
||||
}
|
||||
}
|
||||
|
||||
const mul_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
static mul_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
(&[], &[], &[]),
|
||||
(&[], &[ 1], &[]),
|
||||
(&[ 2], &[], &[]),
|
||||
@ -1112,10 +1112,10 @@ mod biguint_tests {
|
||||
(&[ 0, 0, 1], &[ 0, 0, 0, 1], &[0, 0, 0, 0, 0, 1])
|
||||
];
|
||||
|
||||
const divmod_quadruples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])]
|
||||
static divmod_quadruples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])]
|
||||
= &[
|
||||
(&[ 1], &[ 2], &[], &[1]),
|
||||
(&[ 1, 1], &[ 2], &[-1/2+1], &[1]),
|
||||
@ -1400,9 +1400,9 @@ mod bigint_tests {
|
||||
).to_uint() == 0);
|
||||
}
|
||||
|
||||
const sum_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
static sum_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
(&[], &[], &[]),
|
||||
(&[], &[ 1], &[ 1]),
|
||||
(&[ 1], &[ 1], &[ 2]),
|
||||
@ -1452,9 +1452,9 @@ mod bigint_tests {
|
||||
}
|
||||
}
|
||||
|
||||
const mul_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
static mul_triples: &'static [(&'static [BigDigit],
|
||||
&'static [BigDigit],
|
||||
&'static [BigDigit])] = &[
|
||||
(&[], &[], &[]),
|
||||
(&[], &[ 1], &[]),
|
||||
(&[ 2], &[], &[]),
|
||||
@ -1478,10 +1478,10 @@ mod bigint_tests {
|
||||
(&[ 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]),
|
||||
|
@ -877,7 +877,7 @@ mod tests {
|
||||
use core::vec;
|
||||
use core::rand;
|
||||
|
||||
const bench_bits : uint = 1 << 14;
|
||||
static bench_bits : uint = 1 << 14;
|
||||
|
||||
#[test]
|
||||
pub fn test_to_str() {
|
||||
|
@ -14,7 +14,7 @@ use core::f32;
|
||||
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;
|
||||
|
@ -14,7 +14,7 @@ use core::container::{Container, Mutable};
|
||||
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,
|
||||
|
@ -545,7 +545,7 @@ pub mod writer {
|
||||
|
||||
// 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
|
||||
|
@ -254,7 +254,7 @@ pub trait ByteChan {
|
||||
fn send(&self, val: ~[u8]);
|
||||
}
|
||||
|
||||
const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
|
||||
static CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
|
||||
|
||||
impl<T,U:Unflattener<T>,P:BytePort> GenericPort<T> for FlatPort<T, U, P> {
|
||||
fn recv(&self) -> T {
|
||||
@ -921,7 +921,7 @@ mod test {
|
||||
}
|
||||
|
||||
fn test_try_recv_none3<P:BytePort>(loader: PortLoader<P>) {
|
||||
const CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
|
||||
static CONTINUE: [u8 * 4] = [0xAA, 0xBB, 0xCC, 0xDD];
|
||||
// The control word is followed by garbage
|
||||
let bytes = CONTINUE.to_vec() + ~[0];
|
||||
let port = loader(bytes);
|
||||
@ -940,7 +940,7 @@ mod test {
|
||||
|
||||
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(
|
||||
|
@ -51,7 +51,7 @@ pub mod chained {
|
||||
use core::uint;
|
||||
use core::vec;
|
||||
|
||||
const initial_capacity: uint = 32u; // 2^5
|
||||
static initial_capacity: uint = 32u; // 2^5
|
||||
|
||||
struct Entry<K, V> {
|
||||
hash: uint,
|
||||
|
@ -22,10 +22,10 @@ use future_spawn = future::spawn;
|
||||
* 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
|
||||
|
@ -636,14 +636,14 @@ pub mod node {
|
||||
*
|
||||
* This is not a strict value
|
||||
*/
|
||||
pub const hint_max_leaf_char_len: uint = 256u;
|
||||
pub static hint_max_leaf_char_len: uint = 256u;
|
||||
|
||||
/**
|
||||
* The maximal height that _should_ be permitted in a tree.
|
||||
*
|
||||
* This is not a strict value
|
||||
*/
|
||||
pub const hint_max_node_height: uint = 16u;
|
||||
pub static hint_max_node_height: uint = 16u;
|
||||
|
||||
/**
|
||||
* Adopt a string as a node.
|
||||
|
@ -53,13 +53,13 @@ trait Sha1 {
|
||||
}
|
||||
|
||||
// Some unexported constants
|
||||
const digest_buf_len: uint = 5u;
|
||||
const msg_block_len: uint = 64u;
|
||||
const work_buf_len: uint = 80u;
|
||||
const k0: u32 = 0x5A827999u32;
|
||||
const k1: u32 = 0x6ED9EBA1u32;
|
||||
const k2: u32 = 0x8F1BBCDCu32;
|
||||
const k3: u32 = 0xCA62C1D6u32;
|
||||
static digest_buf_len: uint = 5u;
|
||||
static msg_block_len: uint = 64u;
|
||||
static work_buf_len: uint = 80u;
|
||||
static k0: u32 = 0x5A827999u32;
|
||||
static k1: u32 = 0x6ED9EBA1u32;
|
||||
static k2: u32 = 0x8F1BBCDCu32;
|
||||
static k3: u32 = 0xCA62C1D6u32;
|
||||
|
||||
|
||||
/// Construct a `sha` object
|
||||
|
@ -177,9 +177,9 @@ impl<T:Copy + Ord + Eq> Sort for &'self mut [T] {
|
||||
fn qsort(self) { quick_sort3(self); }
|
||||
}
|
||||
|
||||
const MIN_MERGE: uint = 64;
|
||||
const MIN_GALLOP: uint = 7;
|
||||
const INITIAL_TMP_STORAGE: uint = 128;
|
||||
static MIN_MERGE: uint = 64;
|
||||
static MIN_GALLOP: uint = 7;
|
||||
static INITIAL_TMP_STORAGE: uint = 128;
|
||||
|
||||
pub fn tim_sort<T:Copy + Ord>(array: &mut [T]) {
|
||||
let size = array.len();
|
||||
|
@ -17,24 +17,24 @@ use core::vec;
|
||||
|
||||
// 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]); }
|
||||
|
||||
|
@ -477,10 +477,10 @@ fn run_tests(opts: &TestOpts,
|
||||
|
||||
// Windows tends to dislike being overloaded with threads.
|
||||
#[cfg(windows)]
|
||||
const sched_overcommit : uint = 1;
|
||||
static sched_overcommit : uint = 1;
|
||||
|
||||
#[cfg(unix)]
|
||||
const sched_overcommit : uint = 4u;
|
||||
static sched_overcommit : uint = 4u;
|
||||
|
||||
fn get_concurrency() -> uint {
|
||||
unsafe {
|
||||
|
@ -17,7 +17,7 @@ use core::prelude::*;
|
||||
use core::result::{Result, Ok, Err};
|
||||
use core::str;
|
||||
|
||||
const NSEC_PER_SEC: i32 = 1_000_000_000_i32;
|
||||
static NSEC_PER_SEC: i32 = 1_000_000_000_i32;
|
||||
|
||||
pub mod rustrt {
|
||||
use super::Tm;
|
||||
@ -900,8 +900,8 @@ mod tests {
|
||||
use core::vec;
|
||||
|
||||
pub fn test_get_time() {
|
||||
const some_recent_date: i64 = 1325376000i64; // 2012-01-01T00:00:00Z
|
||||
const some_future_date: i64 = 1577836800i64; // 2020-01-01T00:00:00Z
|
||||
static some_recent_date: i64 = 1325376000i64; // 2012-01-01T00:00:00Z
|
||||
static some_future_date: i64 = 1577836800i64; // 2020-01-01T00:00:00Z
|
||||
|
||||
let tv1 = get_time();
|
||||
debug!("tv1=%? sec + %? nsec", tv1.sec as uint, tv1.nsec as uint);
|
||||
|
@ -15,147 +15,147 @@ pub mod icu {
|
||||
pub type UProperty = int;
|
||||
pub type UChar32 = char;
|
||||
|
||||
pub const TRUE : u8 = 1u8;
|
||||
pub const FALSE : u8 = 1u8;
|
||||
pub static TRUE : u8 = 1u8;
|
||||
pub static 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 const UCHAR_WORD_BREAK : UProperty = 0x1014;
|
||||
pub const UCHAR_INT_LIMIT : UProperty = 0x1015;
|
||||
pub static UCHAR_WORD_BREAK : UProperty = 0x1014;
|
||||
pub static UCHAR_INT_LIMIT : UProperty = 0x1015;
|
||||
|
||||
pub const UCHAR_GENERAL_CATEGORY_MASK : UProperty = 0x2000;
|
||||
pub const UCHAR_MASK_START : UProperty = 0x2000;
|
||||
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"]
|
||||
|
@ -132,8 +132,8 @@ pub struct def_id {
|
||||
node: node_id,
|
||||
}
|
||||
|
||||
pub const local_crate: crate_num = 0;
|
||||
pub const crate_node_id: node_id = 0;
|
||||
pub static local_crate: crate_num = 0;
|
||||
pub static crate_node_id: node_id = 0;
|
||||
|
||||
#[auto_encode]
|
||||
#[auto_decode]
|
||||
|
@ -493,7 +493,7 @@ pub fn core_macros() -> ~str {
|
||||
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),
|
||||
|
@ -16,13 +16,13 @@ use parse::token::Token;
|
||||
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
|
||||
|
@ -309,50 +309,50 @@ pub fn is_bar(t: &Token) -> bool {
|
||||
pub mod special_idents {
|
||||
use ast::ident;
|
||||
|
||||
pub const underscore : ident = ident { repr: 0u };
|
||||
pub const anon : ident = ident { repr: 1u };
|
||||
pub const dtor : ident = ident { repr: 2u }; // 'drop', but that's
|
||||
pub static underscore : ident = ident { repr: 0u };
|
||||
pub static anon : ident = ident { repr: 1u };
|
||||
pub static dtor : ident = ident { repr: 2u }; // 'drop', but that's
|
||||
// reserved
|
||||
pub const invalid : ident = ident { repr: 3u }; // ''
|
||||
pub const unary : ident = ident { repr: 4u };
|
||||
pub const not_fn : ident = ident { repr: 5u };
|
||||
pub const idx_fn : ident = ident { repr: 6u };
|
||||
pub const unary_minus_fn : ident = ident { repr: 7u };
|
||||
pub const clownshoes_extensions : ident = ident { repr: 8u };
|
||||
pub static invalid : ident = ident { repr: 3u }; // ''
|
||||
pub static unary : ident = ident { repr: 4u };
|
||||
pub static not_fn : ident = ident { repr: 5u };
|
||||
pub static idx_fn : ident = ident { repr: 6u };
|
||||
pub static unary_minus_fn : ident = ident { repr: 7u };
|
||||
pub static clownshoes_extensions : ident = ident { repr: 8u };
|
||||
|
||||
pub const self_ : ident = ident { repr: 9u }; // 'self'
|
||||
pub static self_ : ident = ident { repr: 9u }; // 'self'
|
||||
|
||||
/* for matcher NTs */
|
||||
pub const item : ident = ident { repr: 10u };
|
||||
pub const block : ident = ident { repr: 11u };
|
||||
pub const stmt : ident = ident { repr: 12u };
|
||||
pub const pat : ident = ident { repr: 13u };
|
||||
pub const expr : ident = ident { repr: 14u };
|
||||
pub const ty : ident = ident { repr: 15u };
|
||||
pub const ident : ident = ident { repr: 16u };
|
||||
pub const path : ident = ident { repr: 17u };
|
||||
pub const tt : ident = ident { repr: 18u };
|
||||
pub const matchers : ident = ident { repr: 19u };
|
||||
pub 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 const str : ident = ident { repr: 20u }; // for the type
|
||||
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 {
|
||||
|
@ -139,7 +139,7 @@ pub struct print_stack_elt {
|
||||
pbreak: print_stack_break
|
||||
}
|
||||
|
||||
pub const size_infinity: int = 0xffff;
|
||||
pub static size_infinity: int = 0xffff;
|
||||
|
||||
pub fn mk_printer(out: @io::Writer, linewidth: uint) -> @mut Printer {
|
||||
// Yes 3, it makes the ring buffers big enough to never
|
||||
|
@ -92,10 +92,10 @@ pub fn rust_printer(writer: @io::Writer, intr: @ident_interner) -> @ps {
|
||||
};
|
||||
}
|
||||
|
||||
pub const indent_unit: uint = 4u;
|
||||
pub const match_indent_unit: uint = 2u;
|
||||
pub static indent_unit: uint = 4u;
|
||||
pub static match_indent_unit: uint = 2u;
|
||||
|
||||
pub const default_columns: uint = 78u;
|
||||
pub static default_columns: uint = 78u;
|
||||
|
||||
// Requires you to pass an input filename and reader so that
|
||||
// it can scan the input text for comments and literals to
|
||||
|
@ -11,6 +11,6 @@
|
||||
pub extern fn bar() {
|
||||
}
|
||||
|
||||
pub const foopy: &'static str = "hi there";
|
||||
pub const uint_val: uint = 12;
|
||||
pub const uint_expr: uint = (1 << uint_val) - 1;
|
||||
pub static foopy: &'static str = "hi there";
|
||||
pub static uint_val: uint = 12;
|
||||
pub static uint_expr: uint = (1 << uint_val) - 1;
|
||||
|
@ -167,10 +167,10 @@ pub mod NBodySystem {
|
||||
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,
|
||||
|
@ -153,7 +153,7 @@ pub impl Sudoku {
|
||||
// Stores available colors as simple bitfield, bit 0 is always unset
|
||||
struct Colors(u16);
|
||||
|
||||
const heads: u16 = (1u16 << 10) - 1; /* bits 9..0 */
|
||||
static heads: u16 = (1u16 << 10) - 1; /* bits 9..0 */
|
||||
|
||||
impl Colors {
|
||||
fn new(start_color: u8) -> Colors {
|
||||
@ -182,7 +182,7 @@ impl 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],
|
||||
@ -196,7 +196,7 @@ const default_sudoku: [[u8 * 9] * 9] = [
|
||||
];
|
||||
|
||||
#[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],
|
||||
|
@ -10,5 +10,5 @@
|
||||
|
||||
// error-pattern:expected `~str` but found `int`
|
||||
|
||||
const i: str = 10i;
|
||||
static i: ~str = 10i;
|
||||
fn main() { debug!(i); }
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
const foo: int = 5;
|
||||
static foo: int = 5;
|
||||
|
||||
fn main() {
|
||||
// assigning to various global constants
|
||||
|
@ -8,9 +8,9 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
const a: &'static str = &"foo";
|
||||
const b: *u8 = a as *u8; //~ ERROR non-scalar cast
|
||||
const c: *u8 = &a as *u8; //~ ERROR mismatched types
|
||||
static a: &'static str = &"foo";
|
||||
static b: *u8 = a as *u8; //~ ERROR non-scalar cast
|
||||
static c: *u8 = &a as *u8; //~ ERROR mismatched types
|
||||
|
||||
fn main() {
|
||||
}
|
||||
}
|
||||
|
@ -8,8 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
const a: [u8 * 3] = ['h' as u8, 'i' as u8, 0 as u8];
|
||||
const b: *i8 = &a as *i8; //~ ERROR mismatched types
|
||||
static a: [u8 * 3] = ['h' as u8, 'i' as u8, 0 as u8];
|
||||
static b: *i8 = &a as *i8; //~ ERROR mismatched types
|
||||
|
||||
fn main() {
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,8 @@
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern: recursive constant
|
||||
const a: int = b;
|
||||
const b: int = a;
|
||||
static a: int = b;
|
||||
static b: int = a;
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
@ -12,5 +12,5 @@
|
||||
fn foo() -> &'a int {
|
||||
return &x;
|
||||
}
|
||||
const x: int = 5;
|
||||
static x: int = 5;
|
||||
fn main() {}
|
||||
|
@ -11,7 +11,7 @@
|
||||
fn main() {
|
||||
let foo = 100;
|
||||
|
||||
const y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant
|
||||
static y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant
|
||||
|
||||
error!(y);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
fn f(x:int) {
|
||||
const child: int = x + 1; //~ ERROR attempt to use a non-constant value in a constant
|
||||
static child: int = x + 1; //~ ERROR attempt to use a non-constant value in a constant
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -15,7 +15,7 @@ trait PTrait {
|
||||
|
||||
impl PTrait for P {
|
||||
fn getChildOption(&self) -> Option<@P> {
|
||||
const childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
|
||||
static childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
|
||||
fail!();
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
fn foopy() {}
|
||||
|
||||
const f: &'static fn() = foopy; //~ ERROR mismatched types: expected `&'static fn()`
|
||||
static f: &'static fn() = foopy; //~ ERROR mismatched types: expected `&'static fn()`
|
||||
|
||||
fn main () {
|
||||
f();
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// Regression test for issue #4968
|
||||
|
||||
const A: (int,int) = (4,2);
|
||||
static A: (int,int) = (4,2);
|
||||
fn main() {
|
||||
match 42 { A => () } //~ ERROR mismatched types: expected `<VI0>` but found `(int,int)` (expected integral variable but found tuple)
|
||||
}
|
||||
|
@ -8,9 +8,9 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
const c_x: &'blk int = &22; //~ ERROR Illegal lifetime 'blk: only 'static is allowed here
|
||||
const c_y: &int = &22; //~ ERROR Illegal anonymous lifetime: only 'static is allowed here
|
||||
const c_z: &'static int = &22;
|
||||
static c_x: &'blk int = &22; //~ ERROR Illegal lifetime 'blk: only 'static is allowed here
|
||||
static c_y: &int = &22; //~ ERROR Illegal anonymous lifetime: only 'static is allowed here
|
||||
static c_z: &'static int = &22;
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user