]> git.lizzy.rs Git - rust.git/blob - src/libcore/lib.rs
prefer "FIXME" to "TODO".
[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 #![experimental]
52 #![crate_type = "rlib"]
53 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
54        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
55        html_root_url = "http://doc.rust-lang.org/nightly/",
56        html_playground_url = "http://play.rust-lang.org/")]
57
58 #![no_std]
59 #![allow(unknown_features)]
60 #![feature(globs, intrinsics, lang_items, macro_rules, phase)]
61 #![feature(simd, unsafe_destructor, slicing_syntax)]
62 #![feature(default_type_params)]
63 #![deny(missing_docs)]
64
65 mod macros;
66
67 #[path = "num/float_macros.rs"] mod float_macros;
68 #[path = "num/int_macros.rs"]   mod int_macros;
69 #[path = "num/uint_macros.rs"]  mod uint_macros;
70
71 #[path = "num/int.rs"]  pub mod int;
72 #[path = "num/i8.rs"]   pub mod i8;
73 #[path = "num/i16.rs"]  pub mod i16;
74 #[path = "num/i32.rs"]  pub mod i32;
75 #[path = "num/i64.rs"]  pub mod i64;
76
77 #[path = "num/uint.rs"] pub mod uint;
78 #[path = "num/u8.rs"]   pub mod u8;
79 #[path = "num/u16.rs"]  pub mod u16;
80 #[path = "num/u32.rs"]  pub mod u32;
81 #[path = "num/u64.rs"]  pub mod u64;
82
83 #[path = "num/f32.rs"]   pub mod f32;
84 #[path = "num/f64.rs"]   pub mod f64;
85
86 pub mod num;
87
88 /* The libcore prelude, not as all-encompassing as the libstd prelude */
89
90 pub mod prelude;
91
92 /* Core modules for ownership management */
93
94 pub mod intrinsics;
95 pub mod mem;
96 pub mod ptr;
97
98 /* Core language traits */
99
100 pub mod kinds;
101 pub mod ops;
102 pub mod cmp;
103 pub mod clone;
104 pub mod default;
105
106 /* Core types and methods on primitives */
107
108 pub mod any;
109 pub mod atomic;
110 pub mod bool;
111 pub mod borrow;
112 pub mod cell;
113 pub mod char;
114 pub mod panicking;
115 pub mod finally;
116 pub mod iter;
117 pub mod option;
118 pub mod raw;
119 pub mod result;
120 pub mod simd;
121 pub mod slice;
122 pub mod str;
123 pub mod tuple;
124 // FIXME #15320: primitive documentation needs top-level modules, this
125 // should be `core::tuple::unit`.
126 #[path = "tuple/unit.rs"]
127 pub mod unit;
128 pub mod fmt;
129
130 // note: does not need to be public
131 mod array;
132
133 #[doc(hidden)]
134 mod core {
135     pub use panicking;
136 }
137
138 #[doc(hidden)]
139 mod std {
140     pub use clone;
141     pub use cmp;
142     pub use kinds;
143     pub use option;
144     pub use fmt;
145 }