rust/tests/rustdoc-js-std/parser-ident.js
Michael Howell db277f5284 rustdoc-search: search never type with !
This feature extends rustdoc to support the syntax that most users will
naturally attempt to use to search for diverging functions.
Part of #60485

It's already possible to do this search with `primitive:never`, but
that's not what the Rust language itself uses, so nobody will try it if
they aren't told or helped along.
2023-06-12 17:30:23 -07:00

155 lines
3.6 KiB
JavaScript

const PARSED = [
{
query: "R<!>",
elems: [{
name: "r",
fullPath: ["r"],
pathWithoutLast: [],
pathLast: "r",
generics: [
{
name: "never",
fullPath: ["never"],
pathWithoutLast: [],
pathLast: "never",
generics: [],
typeFilter: 15,
},
],
typeFilter: -1,
}],
foundElems: 1,
original: "R<!>",
returned: [],
userQuery: "r<!>",
error: null,
},
{
query: "!",
elems: [{
name: "never",
fullPath: ["never"],
pathWithoutLast: [],
pathLast: "never",
generics: [],
typeFilter: 15,
}],
foundElems: 1,
original: "!",
returned: [],
userQuery: "!",
error: null,
},
{
query: "a!",
elems: [{
name: "a",
fullPath: ["a"],
pathWithoutLast: [],
pathLast: "a",
generics: [],
typeFilter: 14,
}],
foundElems: 1,
original: "a!",
returned: [],
userQuery: "a!",
error: null,
},
{
query: "a!::b",
elems: [],
foundElems: 0,
original: "a!::b",
returned: [],
userQuery: "a!::b",
error: "Cannot have associated items in macros",
},
{
query: "!<T>",
elems: [],
foundElems: 0,
original: "!<T>",
returned: [],
userQuery: "!<t>",
error: "Never type `!` does not accept generic parameters",
},
{
query: "!::b",
elems: [{
name: "!::b",
fullPath: ["never", "b"],
pathWithoutLast: ["never"],
pathLast: "b",
generics: [],
typeFilter: -1,
}],
foundElems: 1,
original: "!::b",
returned: [],
userQuery: "!::b",
error: null,
},
{
query: "b::!",
elems: [],
foundElems: 0,
original: "b::!",
returned: [],
userQuery: "b::!",
error: "Never type `!` is not associated item",
},
{
query: "!::!",
elems: [],
foundElems: 0,
original: "!::!",
returned: [],
userQuery: "!::!",
error: "Never type `!` is not associated item",
},
{
query: "b::!::c",
elems: [],
foundElems: 0,
original: "b::!::c",
returned: [],
userQuery: "b::!::c",
error: "Never type `!` is not associated item",
},
{
query: "!::b<T>",
elems: [{
name: "!::b",
fullPath: ["never", "b"],
pathWithoutLast: ["never"],
pathLast: "b",
generics: [
{
name: "t",
fullPath: ["t"],
pathWithoutLast: [],
pathLast: "t",
generics: [],
typeFilter: -1,
}
],
typeFilter: -1,
}],
foundElems: 1,
original: "!::b<T>",
returned: [],
userQuery: "!::b<t>",
error: null,
},
{
query: "a!::b!",
elems: [],
foundElems: 0,
original: "a!::b!",
returned: [],
userQuery: "a!::b!",
error: "Cannot have associated items in macros",
},
];