File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed
src/librustdoc/html/static/js Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,10 @@ const ROOT_PATH = typeof window !== "undefined" ? window.rootPath : "../";
149149const UNBOXING_LIMIT = 5 ;
150150
151151// used for search query verification
152- const REGEX_IDENT = / \p{ ID_Start} \p{ ID_Continue} * | _ \p{ ID_Continue} + / uy;
152+ // because searches are often performed using substrings of identifiers,
153+ // and not just full identiferes, we allow them to start with chars that otherwise
154+ // can only appear in the middle of identifiers
155+ const REGEX_IDENT = / \p{ ID_Continue} + / uy;
153156const REGEX_INVALID_TYPE_FILTER = / [ ^ a - z ] / ui;
154157
155158const MAX_RESULTS = 200 ;
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ const PARSED = [
165165 foundElems : 0 ,
166166 userQuery : "_:" ,
167167 returned : [ ] ,
168- error : "Unexpected `_` (not a valid identifier )" ,
168+ error : "Unexpected `_` in type filter (before `:` )" ,
169169 } ,
170170 {
171171 query : "ab:" ,
Original file line number Diff line number Diff line change 1+ // regression test for https://github.com/rust-lang/rust/issues/147763
2+ //
3+ // identifiers in search queries should not be required to follow the
4+ // same strict rules around ID_Start that identifers in rust code follow,
5+ // as searches frequently use substrings of identifers.
6+ //
7+ // for example, identifiers cannot start with digits,
8+ // but they can contain them, so we allow search idents to start with digits.
9+
10+ const EXPECTED = {
11+ 'query' : '8' ,
12+ 'others' : [
13+ {
14+ 'path' : 'std' ,
15+ 'name' : 'i8' ,
16+ 'href' : '../std/primitive.i8.html' ,
17+ } ,
18+ ]
19+ } ;
You can’t perform that action at this time.
0 commit comments