rust/tests/rustdoc-js-std/parser-returned.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

98 lines
2.2 KiB
JavaScript

const PARSED = [
{
query: "-> F<P>",
elems: [],
foundElems: 1,
original: "-> F<P>",
returned: [{
name: "f",
fullPath: ["f"],
pathWithoutLast: [],
pathLast: "f",
generics: [
{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [],
},
],
typeFilter: -1,
}],
userQuery: "-> f<p>",
error: null,
},
{
query: "-> P",
elems: [],
foundElems: 1,
original: "-> P",
returned: [{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [],
typeFilter: -1,
}],
userQuery: "-> p",
error: null,
},
{
query: "->,a",
elems: [],
foundElems: 1,
original: "->,a",
returned: [{
name: "a",
fullPath: ["a"],
pathWithoutLast: [],
pathLast: "a",
generics: [],
typeFilter: -1,
}],
userQuery: "->,a",
error: null,
},
{
query: "aaaaa->a",
elems: [{
name: "aaaaa",
fullPath: ["aaaaa"],
pathWithoutLast: [],
pathLast: "aaaaa",
generics: [],
typeFilter: -1,
}],
foundElems: 2,
original: "aaaaa->a",
returned: [{
name: "a",
fullPath: ["a"],
pathWithoutLast: [],
pathLast: "a",
generics: [],
typeFilter: -1,
}],
userQuery: "aaaaa->a",
error: null,
},
{
query: "-> !",
elems: [],
foundElems: 1,
original: "-> !",
returned: [{
name: "never",
fullPath: ["never"],
pathWithoutLast: [],
pathLast: "never",
generics: [],
typeFilter: 15,
}],
userQuery: "-> !",
error: null,
},
];