Skip to content

Commit a213740

Browse files
authored
Rollup merge of #90374 - GuillaumeGomez:unify-rustdoc-book-titles, r=camelid
Unify titles in rustdoc book doc attributes chapter As discussed in #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``
2 parents 86087f9 + 0c70831 commit a213740

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

compiler/rustc_passes/src/check_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ impl CheckAttrVisitor<'tcx> {
765765
"not a `use` item",
766766
);
767767
}
768-
err.note("read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information")
768+
err.note("read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information")
769769
.emit();
770770
},
771771
);

src/doc/rustdoc/src/the-doc-attribute.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ example, if you want your doctests to fail if they produce any warnings, you cou
153153
These forms of the `#[doc]` attribute are used on individual items, to control how
154154
they are documented.
155155

156-
### `#[doc(no_inline)]`/`#[doc(inline)]`
156+
### `inline` and `no_inline`
157+
158+
<span id="docno_inlinedocinline"></span>
157159

158160
These attributes are used on `use` statements, and control where the documentation shows
159161
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.
219221
One special case: In Rust 2018 and later, if you `pub use` one of your dependencies, `rustdoc` will
220222
not eagerly inline it as a module unless you add `#[doc(inline)]`.
221223

222-
### `#[doc(hidden)]`
224+
### `hidden`
225+
226+
<span id="dochidden"></span>
223227

224228
Any item annotated with `#[doc(hidden)]` will not appear in the documentation, unless
225229
the `strip-hidden` pass is removed.

src/test/rustdoc-ui/invalid-doc-attr.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LL | pub fn foo() {}
2929
|
3030
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3131
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
32-
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information
32+
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information
3333

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

7777
error: aborting due to 6 previous errors
7878

src/test/ui/attributes/invalid-doc-attr.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LL | pub fn foo() {}
2929
|
3030
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3131
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
32-
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#docno_inlinedocinline for more information
32+
= note: read https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline for more information
3333

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

7777
error: aborting due to 6 previous errors
7878

0 commit comments

Comments
 (0)