about summary refs log tree commit diff
path: root/src/test/rustdoc-js/generics.rs
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2021-06-26 12:00:26 -0700
committerMichael Howell <michael@notriddle.com>2021-07-01 06:40:27 -0700
commitcedd2425b6ede6669f47794d85c67af1c43bd877 (patch)
tree9cd6c5311604b61952cd88d13256ee1b6692fced /src/test/rustdoc-js/generics.rs
parent3cb1c1134050c059a15d9ca7a00d4dd89111a373 (diff)
downloadrust-cedd2425b6ede6669f47794d85c67af1c43bd877.tar.gz
rust-cedd2425b6ede6669f47794d85c67af1c43bd877.zip
fix(rustdoc): generics search
This commit adds a test case for generics, re-adds generics data
to the search index, and tweaks function indexing to use less space in JSON.

This reverts commit 14ca89446c076bcf484d3d05bd991a4b7985a409.
Diffstat (limited to 'src/test/rustdoc-js/generics.rs')
-rw-r--r--src/test/rustdoc-js/generics.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/rustdoc-js/generics.rs b/src/test/rustdoc-js/generics.rs
new file mode 100644
index 00000000000..a0dc086e9f9
--- /dev/null
+++ b/src/test/rustdoc-js/generics.rs
@@ -0,0 +1,21 @@
+pub struct P;
+pub struct Q;
+pub struct R<T>(T);
+
+// returns test
+pub fn alef() -> R<P> { loop {} }
+pub fn bet() -> R<Q> { loop {} }
+
+// in_args test
+pub fn alpha(_x: R<P>) { loop {} }
+pub fn beta(_x: R<Q>) { loop {} }
+
+// test case with multiple appearances of the same type
+pub struct ExtraCreditStructMulti<T, U> { t: T, u: U }
+pub struct ExtraCreditInnerMulti {}
+pub fn extracreditlabhomework(
+    _param: ExtraCreditStructMulti<ExtraCreditInnerMulti, ExtraCreditInnerMulti>
+) { loop {} }
+pub fn redherringmatchforextracredit(
+    _param: ExtraCreditStructMulti<ExtraCreditInnerMulti, ()>
+) { loop {} }