Skip to content

Commit 70cb58c

Browse files
committed
Auto merge of #85568 - GuillaumeGomez:search-result-extra-info, r=jsha
Search result extra info The CSS rule was not updated when we updated the search result, this fixes it: Before: ![Screenshot from 2021-05-21 22-56-17](https://user-images.githubusercontent.com/3050060/119197314-d31a4e80-ba87-11eb-863a-bc0b3de3bfb2.png) After: ![Screenshot from 2021-05-21 22-54-53](https://user-images.githubusercontent.com/3050060/119197227-b54ce980-ba87-11eb-9f43-c10803ca1b90.png) r? `@jsha`
2 parents 21e1cd9 + 45fd4bc commit 70cb58c

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/librustdoc/html/static/rustdoc.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -780,12 +780,12 @@ a {
780780
float: left;
781781
}
782782

783-
tr.result span.primitive::after {
783+
.result-name span.primitive::after {
784784
content: ' (primitive type)';
785785
font-style: italic;
786786
}
787787

788-
tr.result span.keyword::after {
788+
.result-name span.keyword::after {
789789
content: ' (keyword)';
790790
font-style: italic;
791791
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
goto: file://|DOC_PATH|/test_docs/index.html
2+
write: (".search-input", "CookieMonster")
3+
// Waiting for the search results to appear...
4+
wait-for: "#titles"
5+
// Note: The two next assert commands could be merged as one but readability would be
6+
// less good.
7+
//
8+
// Checking that the CSS is displaying " (keyword)"...
9+
assert: (".result-name span.keyword::after", {"content": '" (keyword)"'})
10+
// ... in italic.
11+
assert: (".result-name span.keyword::after", {"font-style": "italic"})

src/test/rustdoc-gui/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//! documentation generated so we can test each different features.
33
44
#![crate_name = "test_docs"]
5+
#![feature(doc_keyword)]
56

67
use std::fmt;
78

@@ -91,3 +92,6 @@ pub fn check_list_code_block() {}
9192
pub enum AnEnum {
9293
WithVariants { and: usize, sub: usize, variants: usize },
9394
}
95+
96+
#[doc(keyword = "CookieMonster")]
97+
pub mod keyword {}

0 commit comments

Comments
 (0)