Skip to content
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

Unify titles in rustdoc book doc attributes chapter #90374

Merged
merged 1 commit into from
Oct 30, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ impl CheckAttrVisitor<'tcx> {
"not a `use` item",
);
}
err.note("read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information")
err.note("read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information")
.emit();
},
);
Expand Down
8 changes: 6 additions & 2 deletions src/doc/rustdoc/src/the-doc-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ example, if you want your doctests to fail if they produce any warnings, you cou
These forms of the `#[doc]` attribute are used on individual items, to control how
they are documented.

### `#[doc(no_inline)]`/`#[doc(inline)]`
### `inline` and `no_inline`

<span id="docno_inlinedocinline"></span>

GuillaumeGomez marked this conversation as resolved.
Show resolved Hide resolved
These attributes are used on `use` statements, and control where the documentation shows
up. For example, consider this Rust code:
Expand Down Expand Up @@ -219,7 +221,9 @@ Now we'll have a `Re-exports` line, and `Bar` will not link to anywhere.
One special case: In Rust 2018 and later, if you `pub use` one of your dependencies, `rustdoc` will
not eagerly inline it as a module unless you add `#[doc(inline)]`.

### `#[doc(hidden)]`
### `hidden`

<span id="dochidden"></span>

GuillaumeGomez marked this conversation as resolved.
Show resolved Hide resolved
Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless
the `strip-hidden` pass is removed.
Expand Down
4 changes: 2 additions & 2 deletions src/test/rustdoc-ui/invalid-doc-attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LL | pub fn foo() {}
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information

error: this attribute can only be applied at the crate level
--> $DIR/invalid-doc-attr.rs:15:12
Expand Down Expand Up @@ -72,7 +72,7 @@ LL | pub fn baz() {}
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information

error: aborting due to 6 previous errors

4 changes: 2 additions & 2 deletions src/test/ui/attributes/invalid-doc-attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ LL | pub fn foo() {}
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information

error: this attribute can only be applied at the crate level
--> $DIR/invalid-doc-attr.rs:15:12
Expand Down Expand Up @@ -72,7 +72,7 @@ LL | pub fn baz() {}
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information

error: aborting due to 6 previous errors