Skip to content

Commit

Permalink
rustdoc-search: removed dead parser code
Browse files Browse the repository at this point in the history
This is already covered by the normal unexpected char path.
  • Loading branch information
notriddle committed Nov 29, 2023
1 parent c28de27 commit 93f1711
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/librustdoc/html/static/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down
9 changes: 9 additions & 0 deletions tests/rustdoc-js-std/parser-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ const PARSED = [
userQuery: "-> <p>",
error: "Found generics without a path",
},
{
query: '-> *',
elems: [],
foundElems: 0,
original: "-> *",
returned: [],
userQuery: "-> *",
error: "Unexpected `*`",
},
{
query: 'a<"P">',
elems: [],
Expand Down

0 comments on commit 93f1711

Please sign in to comment.