Skip to content

Commit 7b78538

Browse files
committed
Auto merge of #26820 - liigo:patch-2, r=steveklabnik
Closes #26801
2 parents 9748574 + 03afbf9 commit 7b78538

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: src/doc/trpl/comments.md

+11
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ fn add_one(x: i32) -> i32 {
3838
}
3939
```
4040

41+
There is another style of doc comment, `//!`, to comment containing items (e.g.
42+
crates, modules or functions), instead of the items following it. Commonly used
43+
inside crates root (lib.rs) or modules root (mod.rs):
44+
45+
```
46+
//! # The Rust Standard Library
47+
//!
48+
//! The Rust Standard Library provides the essential runtime
49+
//! functionality for building portable Rust software.
50+
```
51+
4152
When writing doc comments, providing some examples of usage is very, very
4253
helpful. You’ll notice we’ve used a new macro here: `assert_eq!`. This compares
4354
two values, and `panic!`s if they’re not equal to each other. It’s very helpful

0 commit comments

Comments
 (0)