2014-04-30 22:05:14 -05:00
|
|
|
// Copyright 2014 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
|
2014-05-12 23:22:35 -05:00
|
|
|
//!
|
|
|
|
//! This library is meant to represent the core functionality of rust that is
|
|
|
|
//! maximally portable to other platforms. To that exent, this library has no
|
|
|
|
//! knowledge of things like allocation, threads, I/O, etc. This library is
|
|
|
|
//! built on the assumption of a few existing symbols:
|
|
|
|
//!
|
|
|
|
//! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
|
|
|
|
//! often generated by LLVM. Additionally, this library can make explicit
|
|
|
|
//! calls to these funcitons. Their signatures are the same as found in C.
|
2014-05-14 13:24:12 -05:00
|
|
|
//! These functions are often provided by the system libc, but can also be
|
|
|
|
//! provided by `librlibc` which is distributed with the standard rust
|
|
|
|
//! distribution.
|
2014-05-12 23:22:35 -05:00
|
|
|
//!
|
|
|
|
//! * `rust_begin_unwind` - This function takes three arguments, a
|
|
|
|
//! `&fmt::Arguments`, a `&str`, and a `uint. These three arguments dictate
|
|
|
|
//! the failure message, the file at which failure was invoked, and the line.
|
|
|
|
//! It is up to consumers of this core library to define this failure
|
|
|
|
//! function; it is only required to never return.
|
|
|
|
//!
|
|
|
|
//! Currently, it is *not* recommended to use the core library. The stable
|
|
|
|
//! functionality of libcore is exported directly into the
|
|
|
|
//! [standard library](../std/index.html). The composition of this library is
|
|
|
|
//! subject to change over time, only the interface exposed through libstd is
|
|
|
|
//! intended to be stable.
|
2014-04-30 22:05:14 -05:00
|
|
|
|
2014-05-12 17:30:24 -05:00
|
|
|
#![crate_id = "core#0.11.0-pre"]
|
2014-04-30 22:05:14 -05:00
|
|
|
#![license = "MIT/ASL2"]
|
|
|
|
#![crate_type = "rlib"]
|
|
|
|
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
|
|
|
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
|
|
|
html_root_url = "http://static.rust-lang.org/doc/master")]
|
|
|
|
|
|
|
|
#![no_std]
|
2014-05-01 20:06:59 -05:00
|
|
|
#![feature(globs, macro_rules, managed_boxes, phase)]
|
2014-04-30 22:05:14 -05:00
|
|
|
#![deny(missing_doc)]
|
2014-04-30 22:04:56 -05:00
|
|
|
|
2014-05-01 20:06:59 -05:00
|
|
|
#[cfg(test)] extern crate realcore = "core";
|
|
|
|
#[cfg(test)] extern crate libc;
|
|
|
|
#[cfg(test)] extern crate native;
|
|
|
|
#[phase(syntax, link)] #[cfg(test)] extern crate realstd = "std";
|
|
|
|
#[phase(syntax, link)] #[cfg(test)] extern crate log;
|
|
|
|
|
|
|
|
#[cfg(test)] pub use cmp = realcore::cmp;
|
2014-05-07 10:20:22 -05:00
|
|
|
#[cfg(test)] pub use kinds = realcore::kinds;
|
2014-05-01 20:06:59 -05:00
|
|
|
#[cfg(test)] pub use ops = realcore::ops;
|
|
|
|
#[cfg(test)] pub use ty = realcore::ty;
|
|
|
|
|
|
|
|
#[cfg(not(test))]
|
2014-05-01 12:47:18 -05:00
|
|
|
mod macros;
|
|
|
|
|
2014-05-01 00:23:26 -05:00
|
|
|
#[path = "num/float_macros.rs"] mod float_macros;
|
|
|
|
#[path = "num/int_macros.rs"] mod int_macros;
|
|
|
|
#[path = "num/uint_macros.rs"] mod uint_macros;
|
|
|
|
|
|
|
|
#[path = "num/int.rs"] pub mod int;
|
|
|
|
#[path = "num/i8.rs"] pub mod i8;
|
|
|
|
#[path = "num/i16.rs"] pub mod i16;
|
|
|
|
#[path = "num/i32.rs"] pub mod i32;
|
|
|
|
#[path = "num/i64.rs"] pub mod i64;
|
|
|
|
|
|
|
|
#[path = "num/uint.rs"] pub mod uint;
|
|
|
|
#[path = "num/u8.rs"] pub mod u8;
|
|
|
|
#[path = "num/u16.rs"] pub mod u16;
|
|
|
|
#[path = "num/u32.rs"] pub mod u32;
|
|
|
|
#[path = "num/u64.rs"] pub mod u64;
|
|
|
|
|
|
|
|
#[path = "num/f32.rs"] pub mod f32;
|
|
|
|
#[path = "num/f64.rs"] pub mod f64;
|
|
|
|
|
2014-05-01 00:14:22 -05:00
|
|
|
pub mod num;
|
|
|
|
|
2014-05-01 20:06:59 -05:00
|
|
|
/* The libcore prelude, not as all-encompassing as the libstd prelude */
|
|
|
|
|
|
|
|
pub mod prelude;
|
|
|
|
|
2014-04-30 22:04:56 -05:00
|
|
|
/* Core modules for ownership management */
|
|
|
|
|
|
|
|
pub mod intrinsics;
|
2014-04-30 22:13:05 -05:00
|
|
|
pub mod mem;
|
2014-04-30 22:17:50 -05:00
|
|
|
pub mod ptr;
|
2014-04-30 22:22:55 -05:00
|
|
|
|
|
|
|
/* Core language traits */
|
|
|
|
|
2014-05-01 20:06:59 -05:00
|
|
|
#[cfg(not(test))] pub mod kinds;
|
|
|
|
#[cfg(not(test))] pub mod ops;
|
|
|
|
#[cfg(not(test))] pub mod ty;
|
|
|
|
#[cfg(not(test))] pub mod cmp;
|
2014-04-30 22:55:38 -05:00
|
|
|
pub mod clone;
|
2014-04-30 22:46:51 -05:00
|
|
|
pub mod default;
|
2014-04-30 22:27:26 -05:00
|
|
|
pub mod container;
|
2014-04-30 22:33:08 -05:00
|
|
|
|
|
|
|
/* Core types and methods on primitives */
|
|
|
|
|
2014-05-01 01:02:55 -05:00
|
|
|
mod unicode;
|
2014-04-30 22:36:58 -05:00
|
|
|
pub mod any;
|
2014-05-12 23:30:48 -05:00
|
|
|
pub mod atomics;
|
2014-04-30 23:11:17 -05:00
|
|
|
pub mod bool;
|
2014-05-01 13:19:56 -05:00
|
|
|
pub mod cell;
|
|
|
|
pub mod char;
|
2014-05-12 23:23:13 -05:00
|
|
|
pub mod failure;
|
2014-04-30 22:34:41 -05:00
|
|
|
pub mod finally;
|
2014-04-30 23:41:03 -05:00
|
|
|
pub mod iter;
|
2014-04-30 23:35:56 -05:00
|
|
|
pub mod option;
|
2014-04-30 22:38:31 -05:00
|
|
|
pub mod raw;
|
2014-05-01 01:25:35 -05:00
|
|
|
pub mod result;
|
2014-05-01 00:54:25 -05:00
|
|
|
pub mod slice;
|
2014-05-01 01:06:36 -05:00
|
|
|
pub mod str;
|
2014-04-30 23:02:13 -05:00
|
|
|
pub mod tuple;
|
2014-05-01 01:19:52 -05:00
|
|
|
|
2014-05-01 12:47:18 -05:00
|
|
|
// FIXME: this module should not exist. Once owned allocations are no longer a
|
|
|
|
// language type, this module can move outside to the owned allocation
|
|
|
|
// crate.
|
2014-05-01 01:19:52 -05:00
|
|
|
mod should_not_exist;
|
2014-05-01 01:25:35 -05:00
|
|
|
|
2014-05-12 23:23:13 -05:00
|
|
|
mod core {
|
|
|
|
pub use failure;
|
|
|
|
}
|
|
|
|
|
2014-05-01 01:25:35 -05:00
|
|
|
mod std {
|
|
|
|
pub use clone;
|
|
|
|
pub use cmp;
|
2014-05-08 17:08:26 -05:00
|
|
|
pub use kinds;
|
2014-05-01 20:06:59 -05:00
|
|
|
|
|
|
|
#[cfg(test)] pub use realstd::fmt; // needed for fail!()
|
|
|
|
#[cfg(test)] pub use realstd::rt; // needed for fail!()
|
|
|
|
#[cfg(test)] pub use realstd::option; // needed for assert!()
|
|
|
|
#[cfg(test)] pub use realstd::os; // needed for tests
|
2014-05-07 23:53:11 -05:00
|
|
|
#[cfg(test)] pub use realstd::slice; // needed for tests
|
|
|
|
#[cfg(test)] pub use realstd::vec; // needed for vec![]
|
2014-05-01 01:25:35 -05:00
|
|
|
}
|