diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-10-30 14:37:00 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-30 14:37:00 +0200 |
| commit | a213740abeb2c4248633b1e3836b38473d2b01ec (patch) | |
| tree | 96302550c6c11489fc63fee715dc8f7409768e65 | |
| parent | 86087f906d4f50dd6ecf6e7e829ffe9ca7533b31 (diff) | |
| parent | 0c708311715befda3fcb7592f2324d96d9afeb74 (diff) | |
| download | rust-a213740abeb2c4248633b1e3836b38473d2b01ec.tar.gz rust-a213740abeb2c4248633b1e3836b38473d2b01ec.zip | |
Rollup merge of #90374 - GuillaumeGomez:unify-rustdoc-book-titles, r=camelid
Unify titles in rustdoc book doc attributes chapter As discussed in https://github.com/rust-lang/rust/pull/90339. I wasn't able to find out where the link to the titles was used so let's see if the CI fails. :) r? ``@camelid``
| -rw-r--r-- | compiler/rustc_passes/src/check_attr.rs | 2 | ||||
| -rw-r--r-- | src/doc/rustdoc/src/the-doc-attribute.md | 8 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/invalid-doc-attr.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/attributes/invalid-doc-attr.stderr | 4 |
4 files changed, 11 insertions, 7 deletions
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index e5fbddda744..596d13d2d9a 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -765,7 +765,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(); }, ); diff --git a/src/doc/rustdoc/src/the-doc-attribute.md b/src/doc/rustdoc/src/the-doc-attribute.md index 5ee06c5f917..a75b6d38931 100644 --- a/src/doc/rustdoc/src/the-doc-attribute.md +++ b/src/doc/rustdoc/src/the-doc-attribute.md @@ -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> These attributes are used on `use` statements, and control where the documentation shows 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 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 the `strip-hidden` pass is removed. diff --git a/src/test/rustdoc-ui/invalid-doc-attr.stderr b/src/test/rustdoc-ui/invalid-doc-attr.stderr index 595ece2ea72..55006b2087e 100644 --- a/src/test/rustdoc-ui/invalid-doc-attr.stderr +++ b/src/test/rustdoc-ui/invalid-doc-attr.stderr @@ -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 @@ -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 diff --git a/src/test/ui/attributes/invalid-doc-attr.stderr b/src/test/ui/attributes/invalid-doc-attr.stderr index 595ece2ea72..55006b2087e 100644 --- a/src/test/ui/attributes/invalid-doc-attr.stderr +++ b/src/test/ui/attributes/invalid-doc-attr.stderr @@ -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 @@ -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 |
