1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! # The Rust Core Library
13 //! The Rust Core Library is the dependency-free foundation of [The
14 //! Rust Standard Library](../std/index.html). It is the portable glue
15 //! between the language and its libraries, defining the intrinsic and
16 //! primitive building blocks of all Rust code. It links to no
17 //! upstream libraries, no system libraries, and no libc.
19 //! The core library is *minimal*: it isn't even aware of heap allocation,
20 //! nor does it provide concurrency or I/O. These things require
21 //! platform integration, and this library is platform-agnostic.
23 //! *It is not recommended to use the core library*. The stable
24 //! functionality of libcore is reexported from the
25 //! [standard library](../std/index.html). The composition of this library is
26 //! subject to change over time; only the interface exposed through libstd is
27 //! intended to be stable.
29 //! # How to use the core library
31 // FIXME: Fill me in with more detail when the interface settles
32 //! This library is built on the assumption of a few existing symbols:
34 //! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
35 //! often generated by LLVM. Additionally, this library can make explicit
36 //! calls to these functions. Their signatures are the same as found in C.
37 //! These functions are often provided by the system libc, but can also be
38 //! provided by `librlibc` which is distributed with the standard rust
41 //! * `rust_begin_unwind` - This function takes three arguments, a
42 //! `&fmt::Arguments`, a `&str`, and a `uint`. These three arguments dictate
43 //! the failure message, the file at which failure was invoked, and the line.
44 //! It is up to consumers of this core library to define this failure
45 //! function; it is only required to never return.
48 #![crate_id = "core#0.11.0"]
50 #![license = "MIT/ASL2"]
51 #![crate_type = "rlib"]
52 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
53 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
54 html_root_url = "http://doc.rust-lang.org/0.11.0/",
55 html_playground_url = "http://play.rust-lang.org/")]
58 #![feature(globs, intrinsics, lang_items, macro_rules, managed_boxes, phase)]
59 #![feature(simd, unsafe_destructor)]
61 #![allow(unknown_features)] // NOTE: remove after stage0 snapshot
63 #[cfg(test)] extern crate realcore = "core";
64 #[cfg(test)] extern crate libc;
65 #[cfg(test)] extern crate native;
66 #[cfg(test)] extern crate realstd = "std";
68 #[cfg(test)] pub use cmp = realcore::cmp;
69 #[cfg(test)] pub use kinds = realcore::kinds;
70 #[cfg(test)] pub use ops = realcore::ops;
71 #[cfg(test)] pub use ty = realcore::ty;
75 #[path = "num/float_macros.rs"] mod float_macros;
76 #[path = "num/int_macros.rs"] mod int_macros;
77 #[path = "num/uint_macros.rs"] mod uint_macros;
79 #[path = "num/int.rs"] pub mod int;
80 #[path = "num/i8.rs"] pub mod i8;
81 #[path = "num/i16.rs"] pub mod i16;
82 #[path = "num/i32.rs"] pub mod i32;
83 #[path = "num/i64.rs"] pub mod i64;
85 #[path = "num/uint.rs"] pub mod uint;
86 #[path = "num/u8.rs"] pub mod u8;
87 #[path = "num/u16.rs"] pub mod u16;
88 #[path = "num/u32.rs"] pub mod u32;
89 #[path = "num/u64.rs"] pub mod u64;
91 #[path = "num/f32.rs"] pub mod f32;
92 #[path = "num/f64.rs"] pub mod f64;
96 /* The libcore prelude, not as all-encompassing as the libstd prelude */
100 /* Core modules for ownership management */
106 /* Core language traits */
108 #[cfg(not(test))] pub mod kinds;
109 #[cfg(not(test))] pub mod ops;
110 #[cfg(not(test))] pub mod ty;
111 #[cfg(not(test))] pub mod cmp;
116 /* Core types and methods on primitives */
149 #[cfg(test)] pub use realstd::rt; // needed for fail!()
150 // #[cfg(test)] pub use realstd::option; // needed for fail!()
151 // #[cfg(test)] pub use realstd::fmt; // needed for fail!()
152 #[cfg(test)] pub use realstd::os; // needed for tests
153 #[cfg(test)] pub use realstd::slice; // needed for tests
154 #[cfg(test)] pub use realstd::vec; // needed for vec![]