rust/tests/rustdoc-js/never-search.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

47 lines
1.2 KiB
JavaScript

// exact-check
const EXPECTED = [
{
'query': '-> !',
'others': [
{ 'path': 'never_search', 'name': 'loops' },
],
},
{
'query': '-> never',
'others': [
{ 'path': 'never_search', 'name': 'loops' },
{ 'path': 'never_search', 'name': 'returns' },
],
},
{
'query': '!',
'in_args': [
{ 'path': 'never_search', 'name': 'impossible' },
{ 'path': 'never_search', 'name': 'box_impossible' },
],
},
{
'query': 'never',
'in_args': [
{ 'path': 'never_search', 'name': 'impossible' },
{ 'path': 'never_search', 'name': 'uninteresting' },
{ 'path': 'never_search', 'name': 'box_impossible' },
{ 'path': 'never_search', 'name': 'box_uninteresting' },
],
},
{
'query': 'box<!>',
'in_args': [
{ 'path': 'never_search', 'name': 'box_impossible' },
],
},
{
'query': 'box<never>',
'in_args': [
{ 'path': 'never_search', 'name': 'box_impossible' },
{ 'path': 'never_search', 'name': 'box_uninteresting' },
],
},
];