Skip to content

Commit a19e103

Browse files
committed
rustdoc: Note that forbidding anchors in links to primitives is a bug
1 parent bc66b92 commit a19e103

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
@@ -1913,6 +1913,10 @@ fn anchor_failure(cx: &DocContext<'_>, diag_info: DiagnosticInfo<'_>, failure: A
19131913
if let Some(sp) = sp {
19141914
diag.span_label(sp, "contains invalid anchor");
19151915
}
1916+
if let AnchorFailure::RustdocAnchorConflict(Res::Primitive(_)) = failure {
1917+
diag.note("this restriction may be lifted in a future release");
1918+
diag.note("see https://github.com/rust-lang/rust/issues/83083 for more information");
1919+
}
19161920
});
19171921
}
19181922

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)