2012-09-19 18:52:32 -05:00
|
|
|
/*!
|
|
|
|
|
|
|
|
The Rust core library.
|
|
|
|
|
|
|
|
The Rust core library provides runtime features required by the language,
|
|
|
|
including the task scheduler and memory allocators, as well as library
|
|
|
|
support for Rust built-in types, platform abstractions, and other commonly
|
|
|
|
used features.
|
|
|
|
|
|
|
|
`core` includes modules corresponding to each of the integer types, each of
|
|
|
|
the floating point types, the `bool` type, tuples, characters, strings,
|
|
|
|
vectors (`vec`), shared boxes (`box`), and unsafe and borrowed pointers
|
2012-09-19 19:17:00 -05:00
|
|
|
(`ptr`). Additionally, `core` provides task management and creation (`task`),
|
|
|
|
communication primitives (`comm` and `pipes`), an efficient vector builder
|
|
|
|
(`dvec`), platform abstractions (`os` and `path`), basic I/O abstractions
|
|
|
|
(`io`), common traits (`cmp`, `num`, `to_str`), and complete bindings
|
|
|
|
to the C standard library (`libc`).
|
2012-09-19 18:52:32 -05:00
|
|
|
|
2012-09-19 19:17:00 -05:00
|
|
|
`core` is linked to all crates by default and its contents imported.
|
|
|
|
Implicitly, all crates behave as if they included the following prologue:
|
2012-09-19 18:52:32 -05:00
|
|
|
|
|
|
|
extern mod core;
|
|
|
|
use core::*;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2011-12-05 18:46:37 -06:00
|
|
|
#[link(name = "core",
|
2012-10-12 18:41:25 -05:00
|
|
|
vers = "0.5",
|
2011-12-05 18:46:37 -06:00
|
|
|
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
|
2012-03-28 15:42:17 -05:00
|
|
|
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
|
2011-12-05 18:46:37 -06:00
|
|
|
|
|
|
|
#[comment = "The Rust core library"];
|
2012-01-08 18:21:43 -06:00
|
|
|
#[license = "MIT"];
|
2011-12-08 23:08:23 -06:00
|
|
|
#[crate_type = "lib"];
|
2011-12-05 18:46:37 -06:00
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// Don't link to core. We are core.
|
|
|
|
#[no_core];
|
|
|
|
|
2012-09-28 23:51:14 -05:00
|
|
|
#[warn(deprecated_mode)];
|
2012-09-28 16:49:49 -05:00
|
|
|
#[warn(deprecated_pattern)];
|
|
|
|
|
2012-09-02 18:21:57 -05:00
|
|
|
#[warn(vecs_implicitly_copyable)];
|
2012-09-09 16:51:56 -05:00
|
|
|
#[deny(non_camel_case_types)];
|
2012-06-04 20:34:24 -05:00
|
|
|
|
2011-12-13 18:25:51 -06:00
|
|
|
// Built-in-type support modules
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `int`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod int {
|
2012-09-28 14:03:54 -05:00
|
|
|
pub use inst::{ pow };
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-14 19:21:10 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i8`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod i8 {
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "i8.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-14 19:21:10 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i16`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod i16 {
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "i16.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-14 19:21:10 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i32`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod i32 {
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "i32.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-14 19:21:10 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i64`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod i64 {
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "i64.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-14 19:21:10 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `uint`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod uint {
|
2012-09-28 16:54:25 -05:00
|
|
|
pub use inst::{
|
2012-09-19 18:35:28 -05:00
|
|
|
div_ceil, div_round, div_floor, iterate,
|
2012-05-16 00:50:29 -05:00
|
|
|
next_power_of_two
|
2012-04-15 00:07:45 -05:00
|
|
|
};
|
|
|
|
#[path = "uint.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-15 00:07:45 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u8`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod u8 {
|
2012-09-28 16:54:25 -05:00
|
|
|
pub use inst::is_ascii;
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "u8.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-15 00:07:45 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u16`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod u16 {
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "u16.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-15 00:07:45 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u32`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod u32 {
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "u32.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-15 00:07:45 -05:00
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u64`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod u64 {
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "u64.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-15 00:07:45 -05:00
|
|
|
}
|
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod box;
|
|
|
|
pub mod char;
|
|
|
|
pub mod float;
|
|
|
|
pub mod f32;
|
|
|
|
pub mod f64;
|
|
|
|
pub mod str;
|
|
|
|
pub mod ptr;
|
|
|
|
pub mod vec;
|
|
|
|
pub mod at_vec;
|
|
|
|
pub mod bool;
|
|
|
|
pub mod tuple;
|
|
|
|
pub mod unit;
|
|
|
|
pub mod uniq;
|
2011-12-13 18:25:51 -06:00
|
|
|
|
|
|
|
// Ubiquitous-utility-type modules
|
|
|
|
|
2012-07-28 16:13:08 -05:00
|
|
|
#[cfg(notest)]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod ops;
|
|
|
|
pub mod cmp;
|
|
|
|
pub mod num;
|
|
|
|
pub mod hash;
|
|
|
|
pub mod either;
|
|
|
|
pub mod iter;
|
|
|
|
pub mod logging;
|
|
|
|
pub mod option;
|
2012-04-11 23:45:18 -05:00
|
|
|
#[path="iter-trait"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod option_iter {
|
2012-04-11 23:45:18 -05:00
|
|
|
#[path = "option.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-04-11 23:45:18 -05:00
|
|
|
}
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod result;
|
|
|
|
pub mod to_str;
|
|
|
|
pub mod to_bytes;
|
|
|
|
pub mod from_str;
|
|
|
|
pub mod util;
|
2012-08-01 18:04:43 -05:00
|
|
|
|
|
|
|
// Data structure modules
|
|
|
|
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod dvec;
|
2012-05-09 19:30:31 -05:00
|
|
|
#[path="iter-trait"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod dvec_iter {
|
2012-05-09 19:30:31 -05:00
|
|
|
#[path = "dvec.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-05-09 19:30:31 -05:00
|
|
|
}
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod dlist;
|
2012-06-29 23:21:15 -05:00
|
|
|
#[path="iter-trait"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod dlist_iter {
|
2012-06-29 23:21:15 -05:00
|
|
|
#[path ="dlist.rs"]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod inst;
|
2012-06-29 23:21:15 -05:00
|
|
|
}
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod send_map;
|
2012-02-22 06:06:38 -06:00
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// Concurrency
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod comm;
|
|
|
|
pub mod task {
|
2012-10-02 18:31:52 -05:00
|
|
|
pub mod local_data;
|
2012-09-19 19:37:09 -05:00
|
|
|
mod local_data_priv;
|
2012-10-02 18:31:52 -05:00
|
|
|
pub mod spawn;
|
|
|
|
pub mod rt;
|
2012-09-19 19:29:54 -05:00
|
|
|
}
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod future;
|
|
|
|
pub mod pipes;
|
2012-02-22 06:06:38 -06:00
|
|
|
|
2011-12-13 18:25:51 -06:00
|
|
|
// Runtime and language-primitive support
|
|
|
|
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod gc;
|
|
|
|
pub mod io;
|
|
|
|
pub mod libc;
|
|
|
|
pub mod os;
|
|
|
|
pub mod path;
|
|
|
|
pub mod rand;
|
|
|
|
pub mod run;
|
|
|
|
pub mod sys;
|
|
|
|
pub mod cast;
|
|
|
|
pub mod mutable;
|
|
|
|
pub mod flate;
|
|
|
|
pub mod repr;
|
|
|
|
pub mod cleanup;
|
|
|
|
pub mod reflect;
|
2012-10-17 18:40:18 -05:00
|
|
|
pub mod condition;
|
2012-08-28 15:59:48 -05:00
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// Modules supporting compiler-generated code
|
|
|
|
// Exported but not part of the public interface
|
2011-12-13 18:25:51 -06:00
|
|
|
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod extfmt;
|
2012-07-10 17:52:05 -05:00
|
|
|
// The test harness links against core, so don't include runtime in tests.
|
|
|
|
#[cfg(notest)]
|
2012-09-21 20:10:45 -05:00
|
|
|
#[legacy_exports]
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod rt;
|
2011-12-13 18:25:51 -06:00
|
|
|
|
2012-10-04 17:54:50 -05:00
|
|
|
// Ideally not exported, but currently is.
|
2012-10-03 21:24:06 -05:00
|
|
|
pub mod private;
|
2012-10-04 17:54:50 -05:00
|
|
|
|
|
|
|
// For internal use, not exported.
|
2012-04-19 03:00:52 -05:00
|
|
|
mod unicode;
|
|
|
|
mod cmath;
|
2012-06-05 20:47:18 -05:00
|
|
|
mod stackwalk;
|
2012-04-19 03:00:52 -05:00
|
|
|
|
2011-12-05 18:46:37 -06:00
|
|
|
// Local Variables:
|
|
|
|
// mode: rust;
|
|
|
|
// fill-column: 78;
|
|
|
|
// indent-tabs-mode: nil
|
|
|
|
// c-basic-offset: 4
|
|
|
|
// buffer-file-coding-system: utf-8-unix
|
|
|
|
// End:
|