Auto merge of #26820 - liigo:patch-2, r=steveklabnik

Closes #26801
This commit is contained in:
bors 2015-07-06 14:49:52 +00:00
commit 7b7853897b

View File

@ -38,6 +38,17 @@ fn add_one(x: i32) -> i32 {
}
```
There is another style of doc comment, `//!`, to comment containing items (e.g.
crates, modules or functions), instead of the items following it. Commonly used
inside crates root (lib.rs) or modules root (mod.rs):
```
//! # The Rust Standard Library
//!
//! The Rust Standard Library provides the essential runtime
//! functionality for building portable Rust software.
```
When writing doc comments, providing some examples of usage is very, very
helpful. Youll notice weve used a new macro here: `assert_eq!`. This compares
two values, and `panic!`s if theyre not equal to each other. Its very helpful