about summary refs log tree commit diff
path: root/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-12-24 18:55:05 -0500
committerJoshua Nelson <jyn514@gmail.com>2020-12-24 20:45:01 -0500
commit6ac52f0d9dc2f3f8a423e3b54663f42ac4ebab05 (patch)
tree0c9b0afae7e303c05224e65f44fd1bfe15e66aac /src/test/rustdoc-ui/intra-doc/non-path-primitives.rs
parent8842c1ccf33649f00e72a6f0be284919a847e69b (diff)
downloadrust-6ac52f0d9dc2f3f8a423e3b54663f42ac4ebab05.tar.gz
rust-6ac52f0d9dc2f3f8a423e3b54663f42ac4ebab05.zip
Don't process `[]` and `()` in intra-doc links
These caused several false positives when documenting rustc, which means
there will likely be many more false positives in the rest of the
ecosystem.
Diffstat (limited to 'src/test/rustdoc-ui/intra-doc/non-path-primitives.rs')
-rw-r--r--src/test/rustdoc-ui/intra-doc/non-path-primitives.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs b/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs
new file mode 100644
index 00000000000..114502b0ddf
--- /dev/null
+++ b/src/test/rustdoc-ui/intra-doc/non-path-primitives.rs
@@ -0,0 +1,34 @@
+#![deny(broken_intra_doc_links)]
+// These are links that could reasonably expected to work, but don't.
+
+// `[]` isn't supported because it had too many false positives.
+//! [X]([T]::not_here)
+//! [Y](&[]::not_here)
+//! [X]([]::not_here)
+//! [Y]([T;N]::not_here)
+
+// These don't work because markdown syntax doesn't allow it.
+//! [[T]::rotate_left] //~ ERROR unresolved link to `T`
+//! [&[]::not_here]
+//![Z]([T; N]::map) //~ ERROR unresolved link to `Z`
+//! [`[T; N]::map`]
+//! [[]::map]
+//! [Z][] //~ ERROR unresolved link to `Z`
+//!
+//! [Z]: [T; N]::map //~ ERROR unresolved link to `Z`
+
+// `()` isn't supported because it had too many false positives.
+//! [()::not_here]
+//! [X]((,)::not_here)
+//! [(,)::not_here]
+
+// FIXME: Associated items on some primitives aren't working, because the impls
+// are part of the compiler instead of being part of the source code.
+//! [unit::eq] //~ ERROR unresolved
+//! [tuple::eq] //~ ERROR unresolved
+//! [fn::eq] //~ ERROR unresolved
+//! [never::eq] //~ ERROR unresolved
+
+// FIXME(#78800): This breaks because it's a blanket impl
+// (I think? Might break for other reasons too.)
+//! [reference::deref] //~ ERROR unresolved