about summary refs log tree commit diff
path: root/tests/rustdoc-js-std/parser-errors.js
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-11-30 09:28:25 +0100
committerGitHub <noreply@github.com>2023-11-30 09:28:25 +0100
commite9a870d5ebebb26833a1789adcb4db53de260025 (patch)
tree79052e067a693f0c99fb15c6714147bd13354983 /tests/rustdoc-js-std/parser-errors.js
parente55544c8043ec2074c1ef2499afc78ee6b5108b7 (diff)
parent930cba8061dca5988a58b4e74774489e1b129184 (diff)
downloadrust-e9a870d5ebebb26833a1789adcb4db53de260025.tar.gz
rust-e9a870d5ebebb26833a1789adcb4db53de260025.zip
Rollup merge of #118452 - notriddle:coloncolonspace, r=GuillaumeGomez,jsha
rustdoc-search: allow spaces around `::` in path query

This restriction made sense back when spaces separated function parameters, but now that they separate path components, there's no real ambiguity any more.

Additionally, the Rust language allows it.

The other two commits are misc code cleanup.
Diffstat (limited to 'tests/rustdoc-js-std/parser-errors.js')
-rw-r--r--tests/rustdoc-js-std/parser-errors.js45
1 files changed, 27 insertions, 18 deletions
diff --git a/tests/rustdoc-js-std/parser-errors.js b/tests/rustdoc-js-std/parser-errors.js
index ab8d72bf71b..f9f9c4f4de8 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,
@@ -144,6 +153,24 @@ const PARSED = [
         error: "Unexpected `::::`",
     },
     {
+        query: "a:: ::b",
+        elems: [],
+        foundElems: 0,
+        original: "a:: ::b",
+        returned: [],
+        userQuery: "a:: ::b",
+        error: "Unexpected `:: ::`",
+    },
+    {
+        query: "a::\t::b",
+        elems: [],
+        foundElems: 0,
+        original: "a:: ::b",
+        returned: [],
+        userQuery: "a:: ::b",
+        error: "Unexpected `:: ::`",
+    },
+    {
         query: "a::b::",
         elems: [],
         foundElems: 0,
@@ -315,24 +342,6 @@ const PARSED = [
         error: 'Unexpected `-` after `<`',
     },
     {
-        query: "a:: a",
-        elems: [],
-        foundElems: 0,
-        original: 'a:: a',
-        returned: [],
-        userQuery: 'a:: a',
-        error: 'Unexpected `:: `',
-    },
-    {
-        query: "a ::a",
-        elems: [],
-        foundElems: 0,
-        original: 'a ::a',
-        returned: [],
-        userQuery: 'a ::a',
-        error: 'Unexpected ` ::`',
-    },
-    {
         query: "a<a>:",
         elems: [],
         foundElems: 0,