about summary refs log tree commit diff
path: root/tests/rustdoc-js
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-05-25 12:58:36 -0700
committerMichael Howell <michael@notriddle.com>2023-06-10 13:52:54 -0700
commit2e569274d3ecbbc74d9c5b3a89a68ee09c19ef2f (patch)
tree020c3d9d28407927968cd42623fec0033d252013 /tests/rustdoc-js
parent3ed4c17d90e0d0c46281fc3503106080b39985b2 (diff)
downloadrust-2e569274d3ecbbc74d9c5b3a89a68ee09c19ef2f.tar.gz
rust-2e569274d3ecbbc74d9c5b3a89a68ee09c19ef2f.zip
rustdoc: search for slices and arrays by type with `[]`
Part of #60485
Diffstat (limited to 'tests/rustdoc-js')
-rw-r--r--tests/rustdoc-js/slice-array.js19
-rw-r--r--tests/rustdoc-js/slice-array.rs2
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/rustdoc-js/slice-array.js b/tests/rustdoc-js/slice-array.js
index 1c06566920c..83b9f69d03e 100644
--- a/tests/rustdoc-js/slice-array.js
+++ b/tests/rustdoc-js/slice-array.js
@@ -51,4 +51,23 @@ const EXPECTED = [
             { 'path': 'slice_array', 'name': 'gamma' },
         ],
     },
+    {
+        'query': '[TraitDog]',
+        'in_args': [
+            { 'path': 'slice_array', 'name': 'gamma' },
+            { 'path': 'slice_array', 'name': 'epsilon' },
+        ],
+    },
+    {
+        'query': 'R<[Q]>',
+        'returned': [
+            { 'path': 'slice_array', 'name': 'bet' },
+        ],
+    },
+    {
+        'query': 'R<[P]>',
+        'in_args': [
+            { 'path': 'slice_array', 'name': 'alpha' },
+        ],
+    },
 ];
diff --git a/tests/rustdoc-js/slice-array.rs b/tests/rustdoc-js/slice-array.rs
index 2523b21cfaa..15ac4294f3d 100644
--- a/tests/rustdoc-js/slice-array.rs
+++ b/tests/rustdoc-js/slice-array.rs
@@ -14,3 +14,5 @@ pub trait TraitCat {}
 pub trait TraitDog {}
 
 pub fn gamma<T: TraitCat + TraitDog>(t: [T; 32]) {}
+
+pub fn epsilon<T: TraitCat + TraitDog>(t: &[T]) {}