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.
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.
11 //! # The Rust Core Library
13 //! The Rust Core Library is the dependency-free[^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.
19 //! [^free]: Strictly speaking, there are some symbols which are needed but
20 //! they aren't always necessary.
22 //! The core library is *minimal*: it isn't even aware of heap allocation,
23 //! nor does it provide concurrency or I/O. These things require
24 //! platform integration, and this library is platform-agnostic.
26 //! # How to use the core library
28 //! Please note that all of these details are currently not considered stable.
30 // FIXME: Fill me in with more detail when the interface settles
31 //! This library is built on the assumption of a few existing symbols:
33 //! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
34 //! often generated by LLVM. Additionally, this library can make explicit
35 //! calls to these functions. Their signatures are the same as found in C.
36 //! These functions are often provided by the system libc, but can also be
37 //! provided by the [rlibc crate](https://crates.io/crates/rlibc).
39 //! * `rust_begin_panic` - This function takes three arguments, a
40 //! `fmt::Arguments`, a `&'static str`, and a `u32`. These three arguments
41 //! dictate the panic message, the file at which panic was invoked, and the
42 //! line. It is up to consumers of this core library to define this panic
43 //! function; it is only required to never return. This requires a `lang`
44 //! attribute named `panic_fmt`.
46 // Since libcore defines many fundamental lang items, all tests live in a
47 // separate crate, libcoretest, to avoid bizarre issues.
49 #![crate_name = "core"]
50 #![stable(feature = "core", since = "1.6.0")]
51 #![crate_type = "rlib"]
52 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
53 html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
54 html_root_url = "https://doc.rust-lang.org/nightly/",
55 html_playground_url = "https://play.rust-lang.org/",
56 issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
57 test(no_crate_inject, attr(deny(warnings))),
58 test(attr(allow(dead_code, deprecated, unused_variables, unused_mut))))]
61 #![deny(missing_docs)]
62 #![deny(missing_debug_implementations)]
63 #![cfg_attr(not(stage0), deny(warnings))]
65 #![cfg_attr(stage0, allow(unused_attributes))]
67 #![feature(allow_internal_unstable)]
69 #![feature(associated_type_defaults)]
70 #![feature(cfg_target_feature)]
71 #![feature(concat_idents)]
73 #![feature(cfg_target_has_atomic)]
74 #![feature(custom_attribute)]
75 #![feature(fundamental)]
76 #![feature(inclusive_range_syntax)]
77 #![feature(intrinsics)]
78 #![feature(lang_items)]
80 #![feature(on_unimplemented)]
81 #![feature(optin_builtin_traits)]
83 #![feature(unwind_attributes)]
84 #![feature(repr_simd, platform_intrinsics)]
85 #![feature(rustc_attrs)]
86 #![feature(specialization)]
87 #![feature(staged_api)]
88 #![feature(unboxed_closures)]
89 #![feature(question_mark)]
94 #[path = "num/float_macros.rs"]
98 #[path = "num/int_macros.rs"]
102 #[path = "num/uint_macros.rs"]
106 #[path = "num/isize.rs"] pub mod isize;
107 #[path = "num/i8.rs"] pub mod i8;
108 #[path = "num/i16.rs"] pub mod i16;
109 #[path = "num/i32.rs"] pub mod i32;
110 #[path = "num/i64.rs"] pub mod i64;
112 #[path = "num/usize.rs"] pub mod usize;
113 #[path = "num/u8.rs"] pub mod u8;
114 #[path = "num/u16.rs"] pub mod u16;
115 #[path = "num/u32.rs"] pub mod u32;
116 #[path = "num/u64.rs"] pub mod u64;
118 #[path = "num/f32.rs"] pub mod f32;
119 #[path = "num/f64.rs"] pub mod f64;
124 /* The libcore prelude, not as all-encompassing as the libstd prelude */
128 /* Core modules for ownership management */
135 /* Core language traits */
145 /* Core types and methods on primitives */
163 // note: does not need to be public