Skip to content

Commit 2568d6b

Browse files
committed
---
yaml --- r: 152025 b: refs/heads/try2 c: bd339ce h: refs/heads/master i: 152023: 82d1b91 v: v3
1 parent df064eb commit 2568d6b

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8dad7f579e029fd883d64848f4abb12630dcc3e6
8+
refs/heads/try2: bd339ced3615c89d439b33f6d6ab7bd04c002f74
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/rustdoc.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,27 @@ pub fn recalibrate() {
4141
# }
4242
~~~
4343

44+
Documentation can also be controlled via the `doc` attribute on items.
45+
46+
~~~
47+
#[doc = "
48+
Calculates the factorial of a number.
49+
50+
Given the input integer `n`, this function will calculate `n!` and return it.
51+
"]
52+
pub fn factorial(n: int) -> int { if n < 2 {1} else {n * factorial(n)} }
53+
~~~
54+
55+
The `doc` attribute can also be used to control how rustdoc emits documentation
56+
in some cases.
57+
58+
```
59+
// Rustdoc will inline documentation of a `pub use` into this crate when the
60+
// `pub use` reaches across crates, but this behavior can also be disabled.
61+
#[doc(no_inline)]
62+
pub use std::option::Option;
63+
```
64+
4465
Doc comments are markdown, and are currently parsed with the
4566
[sundown][sundown] library. rustdoc does not yet do any fanciness such as
4667
referencing other items inline, like javadoc's `@see`. One exception to this

0 commit comments

Comments
 (0)