Skip to content

Commit 846545a

Browse files
committed
auto merge of #6907 : steveklabnik/rust/prelude_docs, r=graydon
2 parents 8a43b31 + fe70361 commit 846545a

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/libstd/prelude.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,24 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! The Rust prelude. Imported into every module by default.
11+
/*!
12+
13+
Many programming languages have a 'prelude': a particular subset of the
14+
libraries that come with the language. Every program imports the prelude by
15+
default.
16+
17+
For example, it would be annoying to add `use io::println;` to every single
18+
program, and the vast majority of Rust programs will wish to print to standard
19+
output. Therefore, it makes sense to import it into every program.
20+
21+
Rust's prelude has three main parts:
22+
23+
1. io::print and io::println.
24+
2. Core operators, such as `Add`, `Mul`, and `Not`.
25+
3. Various types and traits, such as `Clone`, `Eq`, and `comm::Chan`.
26+
27+
*/
28+
1229

1330
// Reexported core operators
1431
pub use either::{Either, Left, Right};

0 commit comments

Comments
 (0)