style guide: suggest manual links to constructors

This commit is contained in:
Martin Pool 2015-10-06 19:42:58 -07:00
parent c21fd9a34f
commit cbf97c3e65
1 changed files with 17 additions and 0 deletions

View File

@ -85,3 +85,20 @@ Use inner doc comments _only_ to document crates and file-level modules:
//!
//! The core library is a something something...
```
### Explain context.
Rust doesn't have special constructors, only functions that return new
instances. These aren't visible in the automatically generated documentation
for a type, so you should specifically link to them:
``` rust
/// An iterator that yields `None` forever after the underlying iterator
/// yields `None` once.
///
/// These can be created through
/// [`iter.fuse()`](trait.Iterator.html#method.fuse).
pub struct Fuse<I> {
// ...
}
```