File tree 4 files changed +56
-4
lines changed
src/librustdoc/html/static/css
4 files changed +56
-4
lines changed Original file line number Diff line number Diff line change @@ -2166,7 +2166,8 @@ details.toggle > summary:not(.hideme)::before {
2166
2166
top : 4px ;
2167
2167
}
2168
2168
2169
- .impl-items > details .toggle > summary : not (.hideme )::before {
2169
+ .impl-items > details .toggle > summary : not (.hideme )::before ,
2170
+ # main-content > .methods > details .toggle > summary : not (.hideme )::before {
2170
2171
position : absolute;
2171
2172
left : -24px ;
2172
2173
}
@@ -2176,7 +2177,9 @@ details.toggle > summary:not(.hideme)::before {
2176
2177
.impl-items > * : not (.item-info ),
2177
2178
/* We also indent the first top doc comment the same to still keep an indent on the
2178
2179
doc block while aligning it with the impl block items. */
2179
- .implementors-toggle > .docblock {
2180
+ .implementors-toggle > .docblock ,
2181
+ /* We indent trait items as well. */
2182
+ # main-content > .methods > : not (.item-info ) {
2180
2183
margin-left : var (--impl-items-indent );
2181
2184
}
2182
2185
@@ -2508,7 +2511,8 @@ in src-script.js and main.js
2508
2511
margin-left : 10px ;
2509
2512
}
2510
2513
2511
- .impl-items > details .toggle > summary : not (.hideme )::before {
2514
+ .impl-items > details .toggle > summary : not (.hideme )::before ,
2515
+ # main-content > .methods > details .toggle > summary : not (.hideme )::before {
2512
2516
left : -20px ;
2513
2517
}
2514
2518
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ call-function: ("check-colors", {
78
78
set-window-size: (851, 600)
79
79
80
80
// Check the size and count in tabs
81
- assert-text: ("#search-tabs > button:nth-child(1) > .count", " (26 ) ")
81
+ assert-text: ("#search-tabs > button:nth-child(1) > .count", " (27 ) ")
82
82
assert-text: ("#search-tabs > button:nth-child(2) > .count", " (7) ")
83
83
assert-text: ("#search-tabs > button:nth-child(3) > .count", " (0) ")
84
84
store-property: ("#search-tabs > button:nth-child(1)", {"offsetWidth": buttonWidth})
Original file line number Diff line number Diff line change @@ -691,3 +691,25 @@ impl ImplDoc {
691
691
impl ImplDoc {
692
692
pub fn bar5 ( ) { }
693
693
}
694
+
695
+ pub trait ItemsTrait {
696
+ /// You want doc, here is doc!
697
+ ///
698
+ /// blablala
699
+ type F ;
700
+
701
+ /// You want doc, here is doc!
702
+ ///
703
+ /// blablala
704
+ const X : u32 ;
705
+
706
+ /// You want doc, here is doc!
707
+ ///
708
+ /// blablala
709
+ fn foo ( ) { }
710
+
711
+ /// You want doc, here is doc!
712
+ ///
713
+ /// blablala
714
+ fn bar ( ) ;
715
+ }
Original file line number Diff line number Diff line change @@ -31,3 +31,29 @@ assert-attribute: (".top-doc", {"open": ""})
31
31
// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked.
32
32
click: (3, 270)
33
33
assert-attribute: (".top-doc", {"open": ""})
34
+
35
+ // Same check on trait items.
36
+ fail-on-request-error: false // To prevent downloads errors on "trait.impl/test_docs/trait.ItemsTrait.js"
37
+ go-to: "file://" + |DOC_PATH| + "/test_docs/trait.ItemsTrait.html"
38
+
39
+ define-function: (
40
+ "check-trait-item",
41
+ [nth, text],
42
+ block {
43
+ store-value: (selector, ".methods:nth-of-type(" + |nth| + ") > details summary")
44
+ assert-text: (|selector| + " h4", |text|)
45
+ assert-position: (
46
+ |selector| + "::before",
47
+ {"x": 6},
48
+ )
49
+ },
50
+ )
51
+
52
+ // Assert the position of the toggle on an associated const.
53
+ call-function: ("check-trait-item", {"nth": 2, "text": "const X: u32"})
54
+ // Assert the position of the toggle on an associated type.
55
+ call-function: ("check-trait-item", {"nth": 3, "text": "type F"})
56
+ // Assert the position of the toggle on an associated required method.
57
+ call-function: ("check-trait-item", {"nth": 4, "text": "fn bar()"})
58
+ // Assert the position of the toggle on an associated provided method.
59
+ call-function: ("check-trait-item", {"nth": 5, "text": "fn foo()"})
You can’t perform that action at this time.
0 commit comments