forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
core.rc
282 lines (224 loc) · 6.59 KB
/
core.rc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
// 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 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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,
vectors (`vec`), managed boxes (`managed`), owned boxes (`owned`), and unsafe
and borrowed pointers (`ptr`). Additionally, `core` provides task management
and creation (`task`), communication primitives (`comm` and `pipes`), platform
abstractions (`os` and `path`), basic I/O abstractions (`io`), common traits
(`cmp`, `num`, `to_str`), and complete bindings to the C standard library
(`libc`).
`core` is linked to all crates by default and its contents imported.
Implicitly, all crates behave as if they included the following prologue:
extern mod core;
use core::*;
*/
#[link(name = "core",
vers = "0.6",
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 core. We are core.
#[no_core];
#[warn(vecs_implicitly_copyable)];
#[deny(non_camel_case_types)];
#[allow(deprecated_mutable_fields)];
#[deny(deprecated_self)];
#[allow(deprecated_drop)];
// 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 {
}
}
/* 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;
pub mod ptr;
pub mod owned;
pub mod managed;
/* Core language traits */
#[cfg(notest)] pub mod kinds;
#[cfg(notest)] pub mod ops;
#[cfg(notest)] pub mod cmp;
// Make core testable by not duplicating lang items. See #2912
#[cfg(test)] extern mod realcore(name = "core", vers = "0.6");
#[cfg(test)] pub use kinds = realcore::kinds;
#[cfg(test)] pub use ops = realcore::ops;
#[cfg(test)] pub use cmp = realcore::cmp;
/* Common traits */
pub mod from_str;
#[path = "num/num.rs"]
pub mod num;
pub mod iter;
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 dlist;
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;
/* 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 mutable;
pub mod flate;
pub mod repr;
pub mod cleanup;
pub mod reflect;
pub mod condition;
pub mod logging;
pub mod util;
/* Reexported core operators */
pub use kinds::{Const, Copy, Owned, Durable};
pub use ops::{Drop};
pub use ops::{Add, Sub, Mul, Div, Modulo, Neg, Not};
pub use ops::{BitAnd, BitOr, BitXor};
pub use ops::{Shl, Shr, Index};
/* Reexported types and traits */
pub use option::{Option, Some, None};
pub use result::{Result, Ok, Err};
pub use path::Path;
pub use path::GenericPath;
pub use path::WindowsPath;
pub use path::PosixPath;
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
pub use str::{StrSlice, Trimmable};
pub use container::{Container, Mutable};
pub use vec::{CopyableVector, ImmutableVector};
pub use vec::{ImmutableEqVector, ImmutableCopyableVector};
pub use vec::{OwnedVector, OwnedCopyableVector};
pub use iter::{BaseIter, ExtendedIter, EqIter, CopyableIter};
pub use iter::{CopyableOrderedIter, CopyableNonstrictIter, Times};
pub use num::NumCast;
pub use ptr::Ptr;
pub use to_str::ToStr;
pub use clone::Clone;
/*
* Export the log levels as global constants. Higher levels mean
* more-verbosity. Error is the bottom level, default logging level is
* warn-and-below.
*/
/// The error log level
#[cfg(stage0)]
pub const error : u32 = 1_u32;
/// The warning log level
#[cfg(stage0)]
pub const warn : u32 = 2_u32;
/// The info log level
#[cfg(stage0)]
pub const info : u32 = 3_u32;
/// The debug log level
#[cfg(stage0)]
pub const debug : u32 = 4_u32;
/* Unsupported interfaces */
// Private APIs
pub mod unstable;
// NOTE: Remove after snapshot
#[cfg(stage0)]
pub mod private {
pub use super::unstable::extfmt;
}
/* For internal use, not exported */
pub mod unicode;
#[path = "num/cmath.rs"]
pub mod cmath;
pub mod stackwalk;
#[path = "rt/mod.rs"]
pub mod rt;
// A curious inner-module that's not exported that contains the binding
// 'core' so that macro-expanded references to core::error and such
// can be resolved within libcore.
#[doc(hidden)]
pub mod core {
#[cfg(stage0)]
pub const error : u32 = 1_u32;
#[cfg(stage0)]
pub const warn : u32 = 2_u32;
#[cfg(stage0)]
pub const info : u32 = 3_u32;
#[cfg(stage0)]
pub const debug : u32 = 4_u32;
pub use cmp;
pub use condition;
pub use option;
pub use kinds;
pub use sys;
pub use pipes;
}
// Local Variables:
// mode: rust;
// fill-column: 78;
// indent-tabs-mode: nil
// c-basic-offset: 4
// buffer-file-coding-system: utf-8-unix
// End: