]> git.lizzy.rs Git - rust.git/blob - src/libcore/lib.rs
Auto merge of #22541 - Manishearth:rollup, r=Gankro
[rust.git] / src / libcore / lib.rs
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.
4 //
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.
10
11 //! # The Rust Core Library
12 //!
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.
18 //!
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.
22 //!
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.
28 //!
29 //! # How to use the core library
30 //!
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:
33 //!
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
39 //!   distribution.
40 //!
41 //! * `rust_begin_unwind` - This function takes three arguments, a
42 //!   `fmt::Arguments`, a `&str`, and a `uint`. These three arguments dictate
43 //!   the panic message, the file at which panic was invoked, and the line.
44 //!   It is up to consumers of this core library to define this panic
45 //!   function; it is only required to never return.
46
47 // Since libcore defines many fundamental lang items, all tests live in a
48 // separate crate, libcoretest, to avoid bizarre issues.
49
50 #![crate_name = "core"]
51 #![unstable(feature = "core")]
52 #![staged_api]
53 #![crate_type = "rlib"]
54 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
55        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
56        html_root_url = "http://doc.rust-lang.org/nightly/",
57        html_playground_url = "http://play.rust-lang.org/")]
58
59 #![feature(no_std)]
60 #![no_std]
61 #![allow(raw_pointer_derive)]
62 #![deny(missing_docs)]
63
64 #![feature(int_uint)]
65 #![feature(intrinsics, lang_items)]
66 #![feature(on_unimplemented)]
67 #![feature(simd, unsafe_destructor)]
68 #![feature(staged_api)]
69 #![feature(unboxed_closures)]
70 #![feature(rustc_attrs)]
71
72 #[macro_use]
73 mod macros;
74
75 #[path = "num/float_macros.rs"]
76 #[macro_use]
77 mod float_macros;
78
79 #[path = "num/int_macros.rs"]
80 #[macro_use]
81 mod int_macros;
82
83 #[path = "num/uint_macros.rs"]
84 #[macro_use]
85 mod uint_macros;
86
87 #[path = "num/int.rs"]  pub mod int;
88 #[path = "num/isize.rs"]  pub mod isize;
89 #[path = "num/i8.rs"]   pub mod i8;
90 #[path = "num/i16.rs"]  pub mod i16;
91 #[path = "num/i32.rs"]  pub mod i32;
92 #[path = "num/i64.rs"]  pub mod i64;
93
94 #[path = "num/uint.rs"] pub mod uint;
95 #[path = "num/usize.rs"] pub mod usize;
96 #[path = "num/u8.rs"]   pub mod u8;
97 #[path = "num/u16.rs"]  pub mod u16;
98 #[path = "num/u32.rs"]  pub mod u32;
99 #[path = "num/u64.rs"]  pub mod u64;
100
101 #[path = "num/f32.rs"]   pub mod f32;
102 #[path = "num/f64.rs"]   pub mod f64;
103
104 pub mod num;
105
106 /* The libcore prelude, not as all-encompassing as the libstd prelude */
107
108 pub mod prelude;
109
110 /* Core modules for ownership management */
111
112 pub mod intrinsics;
113 pub mod mem;
114 pub mod nonzero;
115 pub mod ptr;
116
117 /* Core language traits */
118
119 pub mod marker;
120 pub mod ops;
121 pub mod cmp;
122 pub mod clone;
123 pub mod default;
124
125 /* Core types and methods on primitives */
126
127 pub mod any;
128 pub mod atomic;
129 pub mod cell;
130 pub mod char;
131 pub mod panicking;
132 pub mod finally;
133 pub mod iter;
134 pub mod option;
135 pub mod raw;
136 pub mod result;
137 pub mod simd;
138 pub mod slice;
139 pub mod str;
140 pub mod hash;
141 pub mod fmt;
142 pub mod error;
143
144 #[doc(primitive = "bool")]
145 mod bool {
146 }
147
148 // note: does not need to be public
149 mod tuple;
150 mod array;
151
152 #[doc(hidden)]
153 mod core {
154     pub use panicking;
155     pub use fmt;
156     pub use clone;
157     pub use cmp;
158     pub use hash;
159     pub use marker;
160     pub use option;
161     pub use iter;
162 }
163
164 #[doc(hidden)]
165 mod std {
166     // range syntax
167     pub use ops;
168 }