Skip to content

Commit f4549d2

Browse files
authored
Rollup merge of #84201 - jyn514:primitive-warnings, r=cuviper
rustdoc: Note that forbidding anchors in links to primitives is a bug cc #83083, #84147 (comment) r? `@cuviper`
2 parents f53d1a2 + a19e103 commit f4549d2

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/librustdoc/passes/collect_intra_doc_links.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1972,6 +1972,10 @@ fn anchor_failure(cx: &DocContext<'_>, diag_info: DiagnosticInfo<'_>, failure: A
19721972
if let Some(sp) = sp {
19731973
diag.span_label(sp, "contains invalid anchor");
19741974
}
1975+
if let AnchorFailure::RustdocAnchorConflict(Res::Primitive(_)) = failure {
1976+
diag.note("this restriction may be lifted in a future release");
1977+
diag.note("see https://github.com/rust-lang/rust/issues/83083 for more information");
1978+
}
19751979
});
19761980
}
19771981

src/test/rustdoc-ui/intra-doc/anchors.stderr

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ note: the lint level is defined here
99
|
1010
LL | #![deny(rustdoc::broken_intra_doc_links)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
= note: this restriction may be lifted in a future release
13+
= note: see https://github.com/rust-lang/rust/issues/83083 for more information
1214

1315
error: `Foo::f#hola` contains an anchor, but links to fields are already anchored
1416
--> $DIR/anchors.rs:25:15
@@ -33,6 +35,9 @@ error: `u32#hello` contains an anchor, but links to builtin types are already an
3335
|
3436
LL | /// [u32#hello]
3537
| ^^^^^^^^^ contains invalid anchor
38+
|
39+
= note: this restriction may be lifted in a future release
40+
= note: see https://github.com/rust-lang/rust/issues/83083 for more information
3641

3742
error: aborting due to 5 previous errors
3843

0 commit comments

Comments
 (0)