// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. /*! # 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 (`str`), vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`), and unsafe and borrowed pointers (`ptr`). Additionally, `core` provides pervasive types (`option` and `result`), task creation and communication primitives (`task`, `comm`), platform abstractions (`os` and `path`), basic I/O abstractions (`io`), common traits (`kinds`, `ops`, `cmp`, `num`, `to_str`), and complete bindings to the C standard library (`libc`). # Core injection and the Rust prelude `core` is imported at the topmost level of every crate by default, as if the first line of each crate was extern mod core; This means that the contents of core can be accessed from from any context with the `core::` path prefix, as in `use core::vec`, `use core::task::spawn`, etc. Additionally, `core` contains a `prelude` module that reexports many of the most common core modules, types and traits. The contents of the prelude are imported into every *module* by default. Implicitly, all modules behave as if they contained the following prologue: use core::prelude::*; */ #[link(name = "std", vers = "0.7-pre", uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8", url = "https://github.com/mozilla/rust/tree/master/src/libcore")]; #[comment = "The Rust core library"]; #[license = "MIT/ASL2"]; #[crate_type = "lib"]; // Don't link to std. We are std. #[no_core]; // for stage0 #[no_std]; #[deny(non_camel_case_types)]; // Make core testable by not duplicating lang items. See #2912 #[cfg(test)] extern mod realstd(name = "std"); #[cfg(test)] pub use kinds = realstd::kinds; #[cfg(test)] pub use ops = realstd::ops; #[cfg(test)] pub use cmp = realstd::cmp; // On Linux, link to the runtime with -lrt. #[cfg(target_os = "linux")] #[doc(hidden)] pub mod linkhack { #[link_args="-lrustrt -lrt"] #[link_args = "-lpthread"] extern { } } // Internal macros mod macros; /* The Prelude. */ pub mod prelude; /* Primitive types */ #[path = "num/int-template.rs"] #[merge = "num/int-template/int.rs"] pub mod int; #[path = "num/int-template.rs"] #[merge = "num/int-template/i8.rs"] pub mod i8; #[path = "num/int-template.rs"] #[merge = "num/int-template/i16.rs"] pub mod i16; #[path = "num/int-template.rs"] #[merge = "num/int-template/i32.rs"] pub mod i32; #[path = "num/int-template.rs"] #[merge = "num/int-template/i64.rs"] pub mod i64; #[path = "num/uint-template.rs"] #[merge = "num/uint-template/uint.rs"] pub mod uint; #[path = "num/uint-template.rs"] #[merge = "num/uint-template/u8.rs"] pub mod u8; #[path = "num/uint-template.rs"] #[merge = "num/uint-template/u16.rs"] pub mod u16; #[path = "num/uint-template.rs"] #[merge = "num/uint-template/u32.rs"] pub mod u32; #[path = "num/uint-template.rs"] #[merge = "num/uint-template/u64.rs"] pub mod u64; #[path = "num/float.rs"] pub mod float; #[path = "num/f32.rs"] pub mod f32; #[path = "num/f64.rs"] pub mod f64; pub mod nil; pub mod bool; pub mod char; pub mod tuple; pub mod vec; pub mod at_vec; pub mod str; #[path = "str/ascii.rs"] pub mod ascii; pub mod ptr; pub mod owned; pub mod managed; /* Core language traits */ #[cfg(not(test))] pub mod kinds; #[cfg(not(test))] pub mod ops; #[cfg(not(test))] pub mod cmp; /* Common traits */ pub mod from_str; #[path = "num/num.rs"] pub mod num; pub mod iter; pub mod old_iter; pub mod iterator; pub mod to_str; pub mod to_bytes; pub mod clone; pub mod io; pub mod hash; pub mod container; /* Common data structures */ pub mod option; pub mod result; pub mod either; pub mod hashmap; pub mod cell; pub mod trie; /* Tasks and communication */ #[path = "task/mod.rs"] pub mod task; pub mod comm; pub mod pipes; pub mod local_data; /* Runtime and platform support */ pub mod gc; pub mod libc; pub mod os; pub mod path; pub mod rand; pub mod run; pub mod sys; pub mod cast; pub mod repr; pub mod cleanup; pub mod reflect; pub mod condition; pub mod logging; pub mod util; /* Unsupported interfaces */ // Private APIs #[path = "unstable/mod.rs"] pub mod unstable; /* For internal use, not exported */ mod unicode; #[path = "num/cmath.rs"] mod cmath; mod stackwalk; // XXX: This shouldn't be pub, and it should be reexported under 'unstable' // but name resolution doesn't work without it being pub. #[path = "rt/mod.rs"] pub mod rt; // A curious inner-module that's not exported that contains the binding // 'std' so that macro-expanded references to std::error and such // can be resolved within libstd. #[doc(hidden)] mod core { pub use clone; pub use cmp; pub use condition; pub use option; pub use kinds; pub use sys; pub use pipes; }