about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2021-04-14 16:39:58 -0400
committerJoshua Nelson <jyn514@gmail.com>2021-04-14 16:39:58 -0400
commita19e1034d43b86b37a69182638f281c57f31f197 (patch)
tree31fc668f982b352e143867683d1576b95bf3a3c3
parentbc66b92f7f1114a78b98504a927ca9c0aa12c71a (diff)
downloadrust-a19e1034d43b86b37a69182638f281c57f31f197.tar.gz
rust-a19e1034d43b86b37a69182638f281c57f31f197.zip
rustdoc: Note that forbidding anchors in links to primitives is a bug
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs4
-rw-r--r--src/test/rustdoc-ui/intra-doc/anchors.stderr5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 4bc7544e33d..2e54e8f8f79 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -1913,6 +1913,10 @@ fn anchor_failure(cx: &DocContext<'_>, diag_info: DiagnosticInfo<'_>, failure: A
         if let Some(sp) = sp {
             diag.span_label(sp, "contains invalid anchor");
         }
+        if let AnchorFailure::RustdocAnchorConflict(Res::Primitive(_)) = failure {
+            diag.note("this restriction may be lifted in a future release");
+            diag.note("see https://github.com/rust-lang/rust/issues/83083 for more information");
+        }
     });
 }
 
diff --git a/src/test/rustdoc-ui/intra-doc/anchors.stderr b/src/test/rustdoc-ui/intra-doc/anchors.stderr
index 787a68ed969..42a8832185a 100644
--- a/src/test/rustdoc-ui/intra-doc/anchors.stderr
+++ b/src/test/rustdoc-ui/intra-doc/anchors.stderr
@@ -9,6 +9,8 @@ note: the lint level is defined here
    |
 LL | #![deny(rustdoc::broken_intra_doc_links)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: this restriction may be lifted in a future release
+   = note: see https://github.com/rust-lang/rust/issues/83083 for more information
 
 error: `Foo::f#hola` contains an anchor, but links to fields are already anchored
   --> $DIR/anchors.rs:25:15
@@ -33,6 +35,9 @@ error: `u32#hello` contains an anchor, but links to builtin types are already an
    |
 LL | /// [u32#hello]
    |      ^^^^^^^^^ contains invalid anchor
+   |
+   = note: this restriction may be lifted in a future release
+   = note: see https://github.com/rust-lang/rust/issues/83083 for more information
 
 error: aborting due to 5 previous errors