about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-11-29 10:23:42 -0700
committerMichael Howell <michael@notriddle.com>2023-11-29 11:02:56 -0700
commit93f17117ed50a972bfabea86762241cd9ac5ccbd (patch)
tree504dd3deca82a16d400f71cb42fee32eb779306d
parentc28de27a73521c0814e771120bd0aeecde67d93b (diff)
downloadrust-93f17117ed50a972bfabea86762241cd9ac5ccbd.tar.gz
rust-93f17117ed50a972bfabea86762241cd9ac5ccbd.zip
rustdoc-search: removed dead parser code
This is already covered by the normal unexpected char path.
-rw-r--r--src/librustdoc/html/static/js/search.js2
-rw-r--r--tests/rustdoc-js-std/parser-errors.js9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js
index dc6cdcd569a..37e5276a494 100644
--- a/src/librustdoc/html/static/js/search.js
+++ b/src/librustdoc/html/static/js/search.js
@@ -473,8 +473,6 @@ function initSearch(rawSearchIndex) {
         const path = name.trim();
         if (path.length === 0 && generics.length === 0) {
             throw ["Unexpected ", parserState.userQuery[parserState.pos]];
-        } else if (path === "*") {
-            throw ["Unexpected ", "*"];
         }
         if (query.literalSearch && parserState.totalElems - parserState.genericsElems > 0) {
             throw ["Cannot have more than one element if you use quotes"];
diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js
index 410fe11b9cf..cb1654c0fb0 100644
--- a/tests/rustdoc-js-std/parser-errors.js
+++ b/tests/rustdoc-js-std/parser-errors.js
@@ -18,6 +18,15 @@ const PARSED = [
         error: "Found generics without a path",
     },
     {
+        query: '-> *',
+        elems: [],
+        foundElems: 0,
+        original: "-> *",
+        returned: [],
+        userQuery: "-> *",
+        error: "Unexpected `*`",
+    },
+    {
         query: 'a<"P">',
         elems: [],
         foundElems: 0,