rustdoc: fix test case for generics that look like names

This commit is contained in:
Michael Howell 2023-08-05 12:27:58 -07:00
parent 89a4c7f552
commit 6068850008
3 changed files with 11 additions and 4 deletions

View file

@ -1983,7 +1983,8 @@ function initSearch(rawSearchIndex) {
} }
elem.id = match; elem.id = match;
} }
if ((elem.id === null && parsedQuery.totalElems > 1 && elem.typeFilter === -1) if ((elem.id === null && parsedQuery.totalElems > 1 && elem.typeFilter === -1
&& elem.generics.length === 0)
|| elem.typeFilter === TY_GENERIC) { || elem.typeFilter === TY_GENERIC) {
if (genericSymbols.has(elem.name)) { if (genericSymbols.has(elem.name)) {
elem.id = genericSymbols.get(elem.name); elem.id = genericSymbols.get(elem.name);

View file

@ -23,7 +23,9 @@ function contentToDiffLine(key, value) {
} }
function shouldIgnoreField(fieldName) { function shouldIgnoreField(fieldName) {
return fieldName === "query" || fieldName === "correction"; return fieldName === "query" || fieldName === "correction" ||
fieldName === "proposeCorrectionFrom" ||
fieldName === "proposeCorrectionTo";
} }
// This function is only called when no matching result was found and therefore will only display // This function is only called when no matching result was found and therefore will only display

View file

@ -12,11 +12,15 @@ const EXPECTED = [
], ],
}, },
{ {
'query': 'Result<SomeTraiz>', 'query': 'Resulx<SomeTrait>',
'correction': null,
'in_args': [], 'in_args': [],
'returned': [], 'returned': [],
}, },
{
'query': 'Result<SomeTraiz>',
'proposeCorrectionFrom': 'SomeTraiz',
'proposeCorrectionTo': 'SomeTrait',
},
{ {
'query': 'OtherThingxxxxxxxx', 'query': 'OtherThingxxxxxxxx',
'correction': null, 'correction': null,