Skip to content

Make note of doc duplication with reexports #22132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 16, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/doc/trpl/documentation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% Rust Documentation
% Documentation

`rustdoc` is the built-in tool for generating documentation. It integrates
with the compiler to provide accurate hyperlinking between usage of types and
Expand Down Expand Up @@ -294,3 +294,26 @@ Documentation` on the first line).
Like with a Rust crate, the `--test` argument will run the code
examples to check they compile, and obeys any `--test-args` flags. The
tests are named after the last `#` heading.

# Re-exports

Rustdoc will show the documentation for a publc re-export in both places:

```{rust,ignore}
extern crate foo;

pub use foo::bar;
```

This will create documentation for `bar` both inside the documentation for
the crate `foo`, as well as the documentation for your crate. It will use
the same documentation in both places.

This behavior can be supressed with `no_inline`:

```{rust,ignore}
extern crate foo;

#[doc(no_inline)]
pub use foo::bar;
```