1
Fork 0

Unify titles in rustdoc book doc attributes chapter

This commit is contained in:
Guillaume Gomez 2021-10-28 14:44:47 +02:00
parent f2707fec04
commit 0c70831171
4 changed files with 11 additions and 7 deletions

View file

@ -768,7 +768,7 @@ impl CheckAttrVisitor<'tcx> {
"not a `use` item", "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(); .emit();
}, },
); );

View file

@ -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 These forms of the `#[doc]` attribute are used on individual items, to control how
they are documented. they are documented.
### `#[doc(no_inline)]`/`#[doc(inline)]` ### `inline` and `no_inline`
<span id="docno_inlinedocinline"></span>
These attributes are used on `use` statements, and control where the documentation shows These attributes are used on `use` statements, and control where the documentation shows
up. For example, consider this Rust code: up. For example, consider this Rust code:
@ -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 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)]`. not eagerly inline it as a module unless you add `#[doc(inline)]`.
### `#[doc(hidden)]` ### `hidden`
<span id="dochidden"></span>
Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless
the `strip-hidden` pass is removed. the `strip-hidden` pass is removed.

View file

@ -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! = 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: 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 error: this attribute can only be applied at the crate level
--> $DIR/invalid-doc-attr.rs:15:12 --> $DIR/invalid-doc-attr.rs:15:12
@ -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! = 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: 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 error: aborting due to 6 previous errors

View file

@ -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! = 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: 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 error: this attribute can only be applied at the crate level
--> $DIR/invalid-doc-attr.rs:15:12 --> $DIR/invalid-doc-attr.rs:15:12
@ -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! = 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: 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 error: aborting due to 6 previous errors