2011-12-05 18:46:37 -06:00
|
|
|
#[link(name = "core",
|
2012-07-11 11:09:08 -05:00
|
|
|
vers = "0.3",
|
2011-12-05 18:46:37 -06:00
|
|
|
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
|
2012-03-28 15:42:17 -05:00
|
|
|
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
|
2011-12-05 18:46:37 -06:00
|
|
|
|
|
|
|
#[comment = "The Rust core library"];
|
2012-01-08 18:21:43 -06:00
|
|
|
#[license = "MIT"];
|
2011-12-08 23:08:23 -06:00
|
|
|
#[crate_type = "lib"];
|
2011-12-05 18:46:37 -06:00
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/*!
|
|
|
|
* The Rust core library provides functionality that is closely tied to the
|
|
|
|
* Rust built-in types and runtime services, or that is used in nearly every
|
|
|
|
* non-trivial program.
|
|
|
|
*
|
|
|
|
* `core` includes modules corresponding to each of the integer types, each of
|
|
|
|
* the floating point types, the `bool` type, tuples, characters, strings,
|
|
|
|
* vectors (`vec`), shared boxes (`box`), and unsafe pointers (`ptr`).
|
|
|
|
* Additionally, `core` provides very commonly used built-in types and
|
|
|
|
* operations, concurrency primitives, platform abstractions, I/O, and
|
|
|
|
* complete bindings to the C standard library.
|
|
|
|
*
|
|
|
|
* `core` is linked by default to all crates and the contents imported.
|
|
|
|
* Implicitly, all crates behave as if they included the following prologue:
|
|
|
|
*
|
|
|
|
* use core;
|
|
|
|
* import core::*;
|
|
|
|
*
|
|
|
|
* This behavior can be disabled with the `#[no_core]` crate attribute.
|
|
|
|
*/
|
2012-01-23 18:40:33 -06:00
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// Don't link to core. We are core.
|
|
|
|
#[no_core];
|
|
|
|
|
Nomenclature fixes in the lint checker. Fewer double-negatives.
New style is allow(foo), warn(foo), deny(foo) and forbid(foo),
mirrored by -A foo, -W foo, -D foo and -F foo on command line.
These replace -W no-foo, -W foo, -W err-foo, respectively.
Forbid is new, and means "deny, and you can't override it".
2012-07-26 19:08:21 -05:00
|
|
|
#[allow(vecs_implicitly_copyable)];
|
2012-06-04 20:34:24 -05:00
|
|
|
|
2012-02-12 01:18:26 -06:00
|
|
|
export int, i8, i16, i32, i64;
|
|
|
|
export uint, u8, u16, u32, u64;
|
|
|
|
export float, f32, f64;
|
2012-07-17 18:31:19 -05:00
|
|
|
export box, char, str, ptr, vec, at_vec, bool;
|
2012-01-31 20:52:20 -06:00
|
|
|
export either, option, result, iter;
|
2012-03-14 10:49:28 -05:00
|
|
|
export libc, os, io, run, rand, sys, unsafe, logging;
|
2012-07-06 13:05:28 -05:00
|
|
|
export arc, comm, task, future, pipes;
|
2011-12-13 18:25:51 -06:00
|
|
|
export extfmt;
|
2012-07-10 17:52:05 -05:00
|
|
|
// The test harness links against core, so don't include runtime in tests.
|
|
|
|
// FIXME (#2861): Uncomment this after snapshot gets updated.
|
|
|
|
//#[cfg(notest)]
|
|
|
|
export rt;
|
2012-01-17 12:43:29 -06:00
|
|
|
export tuple;
|
2012-07-05 16:38:59 -05:00
|
|
|
export to_str, to_bytes;
|
2012-08-01 18:12:23 -05:00
|
|
|
export util;
|
2012-05-09 19:30:31 -05:00
|
|
|
export dvec, dvec_iter;
|
2012-07-14 00:24:26 -05:00
|
|
|
export dlist, dlist_iter;
|
2012-07-30 12:55:44 -05:00
|
|
|
export send_map;
|
2012-07-24 16:32:06 -05:00
|
|
|
export hash;
|
2012-06-06 16:19:52 -05:00
|
|
|
export cmp;
|
2012-06-07 18:08:38 -05:00
|
|
|
export num;
|
2011-12-13 18:25:51 -06:00
|
|
|
|
2012-04-11 23:45:18 -05:00
|
|
|
// NDM seems to be necessary for resolve to work
|
2012-06-02 21:03:28 -05:00
|
|
|
export option_iter;
|
2012-04-11 23:45:18 -05:00
|
|
|
|
2012-06-21 18:44:10 -05:00
|
|
|
// FIXME (#2648): This creates some APIs that I do not want to commit
|
|
|
|
// to. It is currently exported for the uv code in std, but when that
|
|
|
|
// code moves into core this should become unexported
|
2012-04-04 23:17:50 -05:00
|
|
|
export priv;
|
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
|
2011-12-13 18:25:51 -06:00
|
|
|
// Built-in-type support modules
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `int`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
|
|
|
mod int {
|
2012-05-16 01:18:04 -05:00
|
|
|
import inst::{ hash, pow };
|
|
|
|
export hash, pow;
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i8`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
|
|
|
mod i8 {
|
|
|
|
#[path = "i8.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i16`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
|
|
|
mod i16 {
|
|
|
|
#[path = "i16.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i32`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
|
|
|
mod i32 {
|
|
|
|
#[path = "i32.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `i64`
|
2012-04-14 19:21:10 -05:00
|
|
|
#[path = "int-template"]
|
|
|
|
mod i64 {
|
|
|
|
#[path = "i64.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `uint`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
|
|
|
mod uint {
|
|
|
|
import inst::{
|
|
|
|
div_ceil, div_round, div_floor, hash, iterate,
|
2012-05-16 00:50:29 -05:00
|
|
|
next_power_of_two
|
2012-04-15 00:07:45 -05:00
|
|
|
};
|
|
|
|
export div_ceil, div_round, div_floor, hash, iterate,
|
2012-05-16 00:50:29 -05:00
|
|
|
next_power_of_two;
|
2012-04-15 00:07:45 -05:00
|
|
|
|
|
|
|
#[path = "uint.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u8`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
|
|
|
mod u8 {
|
|
|
|
import inst::is_ascii;
|
|
|
|
export is_ascii;
|
|
|
|
|
|
|
|
#[path = "u8.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u16`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
|
|
|
mod u16 {
|
|
|
|
#[path = "u16.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u32`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
|
|
|
mod u32 {
|
|
|
|
#[path = "u32.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-07-04 16:53:12 -05:00
|
|
|
/// Operations and constants for `u64`
|
2012-04-15 00:07:45 -05:00
|
|
|
#[path = "uint-template"]
|
|
|
|
mod u64 {
|
|
|
|
#[path = "u64.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
|
2011-12-13 18:25:51 -06:00
|
|
|
mod box;
|
|
|
|
mod char;
|
|
|
|
mod float;
|
2011-12-13 19:52:02 -06:00
|
|
|
mod f32;
|
|
|
|
mod f64;
|
2011-12-13 18:25:51 -06:00
|
|
|
mod str;
|
|
|
|
mod ptr;
|
|
|
|
mod vec;
|
2012-07-17 18:31:19 -05:00
|
|
|
mod at_vec;
|
2011-12-13 18:25:51 -06:00
|
|
|
mod bool;
|
2012-04-19 03:00:52 -05:00
|
|
|
mod tuple;
|
2011-12-13 18:25:51 -06:00
|
|
|
|
|
|
|
// Ubiquitous-utility-type modules
|
|
|
|
|
2012-07-28 16:13:08 -05:00
|
|
|
#[cfg(notest)]
|
2012-07-25 20:36:18 -05:00
|
|
|
mod ops;
|
2012-06-06 16:19:52 -05:00
|
|
|
mod cmp;
|
2012-06-07 18:08:38 -05:00
|
|
|
mod num;
|
2012-07-24 16:32:06 -05:00
|
|
|
mod hash;
|
2011-12-13 18:25:51 -06:00
|
|
|
mod either;
|
2012-04-19 03:00:52 -05:00
|
|
|
mod iter;
|
|
|
|
mod logging;
|
2011-12-13 18:25:51 -06:00
|
|
|
mod option;
|
2012-04-11 23:45:18 -05:00
|
|
|
#[path="iter-trait"]
|
|
|
|
mod option_iter {
|
|
|
|
#[path = "option.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
2011-12-13 18:25:51 -06:00
|
|
|
mod result;
|
2012-04-19 03:00:52 -05:00
|
|
|
mod to_str;
|
2012-07-05 16:40:45 -05:00
|
|
|
mod to_bytes;
|
2012-08-01 18:04:43 -05:00
|
|
|
mod util;
|
|
|
|
|
|
|
|
// Data structure modules
|
|
|
|
|
2012-05-09 19:30:31 -05:00
|
|
|
mod dvec;
|
|
|
|
#[path="iter-trait"]
|
|
|
|
mod dvec_iter {
|
|
|
|
#[path = "dvec.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
2012-06-29 23:21:15 -05:00
|
|
|
mod dlist;
|
|
|
|
#[path="iter-trait"]
|
|
|
|
mod dlist_iter {
|
|
|
|
#[path ="dlist.rs"]
|
|
|
|
mod inst;
|
|
|
|
}
|
2012-07-30 12:55:44 -05:00
|
|
|
mod send_map;
|
2012-02-22 06:06:38 -06:00
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// Concurrency
|
2012-06-06 19:58:15 -05:00
|
|
|
mod arc;
|
2012-04-19 03:00:52 -05:00
|
|
|
mod comm;
|
|
|
|
mod task;
|
|
|
|
mod future;
|
2012-06-29 20:15:28 -05:00
|
|
|
mod pipes;
|
2012-02-22 06:06:38 -06:00
|
|
|
|
2011-12-13 18:25:51 -06:00
|
|
|
// Runtime and language-primitive support
|
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
mod io;
|
2012-02-27 19:22:42 -06:00
|
|
|
mod libc;
|
2012-03-06 12:14:58 -06:00
|
|
|
mod os;
|
2012-03-02 19:20:00 -06:00
|
|
|
mod path;
|
2012-04-19 03:00:52 -05:00
|
|
|
mod rand;
|
|
|
|
mod run;
|
2011-12-13 18:25:51 -06:00
|
|
|
mod sys;
|
|
|
|
mod unsafe;
|
2012-02-14 18:39:20 -06:00
|
|
|
|
2011-12-13 18:25:51 -06:00
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// Modules supporting compiler-generated code
|
|
|
|
// Exported but not part of the public interface
|
2011-12-13 18:25:51 -06:00
|
|
|
|
|
|
|
mod extfmt;
|
2012-07-10 17:52:05 -05:00
|
|
|
// The test harness links against core, so don't include runtime in tests.
|
|
|
|
#[cfg(notest)]
|
|
|
|
mod rt;
|
2011-12-13 18:25:51 -06:00
|
|
|
|
|
|
|
|
2012-04-19 03:00:52 -05:00
|
|
|
// For internal use, not exported
|
|
|
|
|
|
|
|
mod unicode;
|
|
|
|
mod priv;
|
|
|
|
mod cmath;
|
2012-06-05 20:47:18 -05:00
|
|
|
mod stackwalk;
|
2012-04-19 03:00:52 -05:00
|
|
|
|
2011-12-05 18:46:37 -06:00
|
|
|
// Local Variables:
|
|
|
|
// mode: rust;
|
|
|
|
// fill-column: 78;
|
|
|
|
// indent-tabs-mode: nil
|
|
|
|
// c-basic-offset: 4
|
|
|
|
// buffer-file-coding-system: utf-8-unix
|
|
|
|
// End:
|