diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index bd03ab85c2c66..593c7cba3a7a9 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -796,16 +796,6 @@ a {
display: inline-block;
}
-.result-name span.primitive::after {
- content: ' (primitive type)';
- font-style: italic;
-}
-
-.result-name span.keyword::after {
- content: ' (keyword)';
- font-style: italic;
-}
-
body.blur > :not(#help) {
filter: blur(8px);
-webkit-filter: blur(8px);
diff --git a/src/librustdoc/html/static/search.js b/src/librustdoc/html/static/search.js
index 634e5fa578708..26b14f675f68d 100644
--- a/src/librustdoc/html/static/search.js
+++ b/src/librustdoc/html/static/search.js
@@ -975,26 +975,32 @@ window.initSearch = function(rawSearchIndex) {
output = "
";
array.forEach(function(item) {
- var name, type;
-
- name = item.name;
- type = itemTypes[item.ty];
-
if (item.is_alias !== true) {
if (duplicates[item.fullPath]) {
return;
}
duplicates[item.fullPath] = true;
}
+
+ var name = item.name;
+ var type = itemTypes[item.ty];
+
length += 1;
+ var extra = "";
+ if (type === "primitive") {
+ extra = "
(primitive type)";
+ } else if (type === "keyword") {
+ extra = "
(keyword)";
+ }
+
output += "
" +
"" +
(item.is_alias === true ?
("" + item.alias + " - see ") : "") +
item.displayPath + "" +
- name + "
" +
+ name + extra + "
" +
"" + item.desc +
"
";
});
diff --git a/src/test/rustdoc-gui/search-result-keyword.goml b/src/test/rustdoc-gui/search-result-keyword.goml
index 23552c8ce89be..e7612d663717a 100644
--- a/src/test/rustdoc-gui/search-result-keyword.goml
+++ b/src/test/rustdoc-gui/search-result-keyword.goml
@@ -5,7 +5,6 @@ wait-for: "#titles"
// Note: The two next assert commands could be merged as one but readability would be
// less good.
//
-// Checking that the CSS is displaying " (keyword)"...
-assert: (".result-name span.keyword::after", {"content": '" (keyword)"'})
-// ... in italic.
-assert: (".result-name span.keyword::after", {"font-style": "italic"})
+// Checking that the CSS is displaying " (keyword)" in italic.
+assert: (".result-name span.keyword > i", "(keyword)")
+assert: (".result-name span.keyword", "CookieMonster (keyword)")