about summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-05-04 19:08:23 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-08-10 12:00:08 +0200
commitd528a49fd7c0447cc51406908fb13fe055d273aa (patch)
treef4a96585e52802f820c4f2227a7086d4f3416af0 /tests/rustdoc
parent1a6d6363d090961a1efe513d413f5b51ecd81ab8 (diff)
downloadrust-d528a49fd7c0447cc51406908fb13fe055d273aa.tar.gz
rust-d528a49fd7c0447cc51406908fb13fe055d273aa.zip
Fix panic if an item does not have a body
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/jump-to-def-ice.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/rustdoc/jump-to-def-ice.rs b/tests/rustdoc/jump-to-def-ice.rs
new file mode 100644
index 00000000000..5578b9af3d7
--- /dev/null
+++ b/tests/rustdoc/jump-to-def-ice.rs
@@ -0,0 +1,24 @@
+// This test ensures that items with no body don't panic when generating
+// jump to def links.
+
+//@ compile-flags: -Zunstable-options --generate-link-to-definition
+
+#![crate_name = "foo"]
+
+//@ has 'src/foo/jump-to-def-ice.rs.html'
+
+pub trait A {
+    type T;
+    type U;
+}
+
+impl A for () {
+    type T = Self::U;
+    type U = ();
+}
+
+pub trait C {
+    type X;
+}
+
+pub struct F<T: C>(pub T::X);