]> git.lizzy.rs Git - rust.git/blob - src/libcore/lib.rs
auto merge of #14053 : FlaPer87/rust/master, r=huonw
[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 #![crate_id = "core#0.11-pre"]
14 #![license = "MIT/ASL2"]
15 #![crate_type = "rlib"]
16 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
17        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
18        html_root_url = "http://static.rust-lang.org/doc/master")]
19
20 #![no_std]
21 #![feature(globs, macro_rules, managed_boxes, phase)]
22 #![deny(missing_doc)]
23
24 #[cfg(test)] extern crate realcore = "core";
25 #[cfg(test)] extern crate libc;
26 #[cfg(test)] extern crate native;
27 #[phase(syntax, link)] #[cfg(test)] extern crate realstd = "std";
28 #[phase(syntax, link)] #[cfg(test)] extern crate log;
29
30 #[cfg(test)] pub use cmp = realcore::cmp;
31 #[cfg(test)] pub use kinds = realcore::kinds;
32 #[cfg(test)] pub use ops = realcore::ops;
33 #[cfg(test)] pub use owned = realcore::owned;
34 #[cfg(test)] pub use ty = realcore::ty;
35
36 #[cfg(not(test))]
37 mod macros;
38
39 #[path = "num/float_macros.rs"] mod float_macros;
40 #[path = "num/int_macros.rs"]   mod int_macros;
41 #[path = "num/uint_macros.rs"]  mod uint_macros;
42
43 #[path = "num/int.rs"]  pub mod int;
44 #[path = "num/i8.rs"]   pub mod i8;
45 #[path = "num/i16.rs"]  pub mod i16;
46 #[path = "num/i32.rs"]  pub mod i32;
47 #[path = "num/i64.rs"]  pub mod i64;
48
49 #[path = "num/uint.rs"] pub mod uint;
50 #[path = "num/u8.rs"]   pub mod u8;
51 #[path = "num/u16.rs"]  pub mod u16;
52 #[path = "num/u32.rs"]  pub mod u32;
53 #[path = "num/u64.rs"]  pub mod u64;
54
55 #[path = "num/f32.rs"]   pub mod f32;
56 #[path = "num/f64.rs"]   pub mod f64;
57
58 pub mod num;
59
60 /* The libcore prelude, not as all-encompassing as the libstd prelude */
61
62 pub mod prelude;
63
64 /* Core modules for ownership management */
65
66 pub mod cast;
67 pub mod intrinsics;
68 pub mod mem;
69 pub mod ptr;
70
71 /* Core language traits */
72
73 #[cfg(not(test))] pub mod kinds;
74 #[cfg(not(test))] pub mod ops;
75 #[cfg(not(test))] pub mod ty;
76 #[cfg(not(test))] pub mod cmp;
77 #[cfg(not(test))] pub mod owned;
78 pub mod clone;
79 pub mod default;
80 pub mod container;
81
82 /* Core types and methods on primitives */
83
84 mod unicode;
85 mod unit;
86 pub mod any;
87 pub mod bool;
88 pub mod cell;
89 pub mod char;
90 pub mod finally;
91 pub mod iter;
92 pub mod option;
93 pub mod raw;
94 pub mod result;
95 pub mod slice;
96 pub mod str;
97 pub mod tuple;
98
99 mod failure;
100
101 // FIXME: this module should not exist. Once owned allocations are no longer a
102 //        language type, this module can move outside to the owned allocation
103 //        crate.
104 mod should_not_exist;
105
106 mod std {
107     pub use clone;
108     pub use cmp;
109     pub use kinds;
110
111     #[cfg(test)] pub use realstd::fmt;    // needed for fail!()
112     #[cfg(test)] pub use realstd::rt;     // needed for fail!()
113     #[cfg(test)] pub use realstd::option; // needed for assert!()
114     #[cfg(test)] pub use realstd::os;     // needed for tests
115     #[cfg(test)] pub use realstd::slice;  // needed for tests
116     #[cfg(test)] pub use realstd::vec;    // needed for vec![]
117 }