about summary refs log tree commit diff
path: root/tests/rustdoc-json/generic_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-json/generic_impl.rs')
-rw-r--r--tests/rustdoc-json/generic_impl.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/rustdoc-json/generic_impl.rs b/tests/rustdoc-json/generic_impl.rs
new file mode 100644
index 00000000000..31f41d0f335
--- /dev/null
+++ b/tests/rustdoc-json/generic_impl.rs
@@ -0,0 +1,23 @@
+// Regression test for <https://github.com/rust-lang/rust/issues/97986>.
+
+// @has "$.index[*][?(@.name=='f')]"
+// @has "$.index[*][?(@.name=='AssocTy')]"
+// @has "$.index[*][?(@.name=='AssocConst')]"
+
+pub mod m {
+    pub struct S;
+}
+
+pub trait F {
+    type AssocTy;
+    const AssocConst: usize;
+    fn f() -> m::S;
+}
+
+impl<T> F for T {
+    type AssocTy = u32;
+    const AssocConst: usize = 0;
+    fn f() -> m::S {
+        m::S
+    }
+}