diff options
| author | bors <bors@rust-lang.org> | 2015-07-06 14:49:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-06 14:49:52 +0000 |
| commit | 7b7853897ba1469d7bb47fb6e4b877b6741fbb4b (patch) | |
| tree | 66538ea439b6b05e12bf3ed65e89bd2a48815d02 /src | |
| parent | 9748574271847c1d6e65b71eca175cfcac9361f5 (diff) | |
| parent | 03afbf93ed6fff191e641bc021c42631e9197ba9 (diff) | |
| download | rust-7b7853897ba1469d7bb47fb6e4b877b6741fbb4b.tar.gz rust-7b7853897ba1469d7bb47fb6e4b877b6741fbb4b.zip | |
Auto merge of #26820 - liigo:patch-2, r=steveklabnik
Closes #26801
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/trpl/comments.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/doc/trpl/comments.md b/src/doc/trpl/comments.md index 7687d2a57da..e7eb48dc42c 100644 --- a/src/doc/trpl/comments.md +++ b/src/doc/trpl/comments.md @@ -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. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares two values, and `panic!`s if they’re not equal to each other. It’s very helpful |
