Skip to content

Commit 01e20dd

Browse files
committed
core: Improve docs
1 parent 9604544 commit 01e20dd

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
lines changed

src/libcore/core.rc

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,30 @@
77
#[license = "MIT"];
88
#[crate_type = "lib"];
99

10-
// Don't link to core. We are core.
11-
#[no_core];
12-
1310
#[doc = "
14-
The Rust core library
15-
16-
The core library provides functionality that is closely tied to the Rust
11+
The Rust core library provides functionality that is closely tied to the Rust
1712
built-in types and runtime services, or that is used in nearly every
1813
non-trivial program.
1914

20-
It is linked by default to all crates and the contents imported. The effect is
21-
as though the user had written the following:
15+
`core` includes modules corresponding to each of the integer types, each of
16+
the floating point types, the `bool` type, tules, characters, strings, vectors
17+
(`vec`), shared boxes (`box`), and unsafe pointers (`ptr`). Additionally,
18+
`core` provides very commonly used built-in types and operations, concurrency
19+
primitives, platform abstractions, I/O, and complete bindings to the C
20+
standard library.
21+
22+
`core` is linked by default to all crates and the contents imported.
23+
Implicitly, all crates behave as if they included the following prologue:
2224

2325
use core;
2426
import core::*;
2527

26-
This behavior can be disabled with the `no_core` crate attribute.
28+
This behavior can be disabled with the `#[no_core]` crate attribute.
2729
"];
2830

31+
// Don't link to core. We are core.
32+
#[no_core];
33+
2934
export int, i8, i16, i32, i64;
3035
export uint, u8, u16, u32, u64;
3136
export float, f32, f64;
@@ -42,6 +47,7 @@ export to_str;
4247
// core this should become unexported
4348
export priv;
4449

50+
4551
// Built-in-type support modules
4652

4753
#[doc = "Operations and constants for `int`"]
@@ -129,6 +135,7 @@ mod u64 {
129135
mod inst;
130136
}
131137

138+
132139
mod box;
133140
mod char;
134141
mod float;
@@ -138,48 +145,50 @@ mod str;
138145
mod ptr;
139146
mod vec;
140147
mod bool;
148+
mod tuple;
141149

142-
// For internal use by char, not exported
143-
mod unicode;
144-
// Do not export
145-
mod priv;
146150

147151
// Ubiquitous-utility-type modules
148152

149153
mod either;
154+
mod iter;
155+
mod logging;
150156
mod option;
151157
mod result;
152-
mod tuple;
153-
mod iter;
158+
mod to_str;
154159

155-
// Useful ifaces
156160

157-
mod to_str;
161+
// Concurrency
162+
mod comm;
163+
mod task;
164+
mod future;
165+
158166

159167
// Runtime and language-primitive support
160168

169+
mod io;
161170
mod libc;
162171
mod os;
163-
mod io;
164-
mod run;
165-
mod rand;
166172
mod path;
167-
168-
mod cmath;
173+
mod rand;
174+
mod run;
169175
mod sys;
170176
mod unsafe;
171-
mod logging;
172177

173-
// Concurrency
174-
mod comm;
175-
mod task;
176-
mod future;
177178

178-
// Compiler support modules
179+
// Modules supporting compiler-generated code
180+
// Exported but not part of the public interface
179181

180182
mod extfmt;
181183

182184

185+
// For internal use, not exported
186+
187+
mod unicode;
188+
mod priv;
189+
mod cmath;
190+
191+
183192
// Local Variables:
184193
// mode: rust;
185194
// fill-column: 78;

0 commit comments

Comments
 (0)