File tree 11 files changed +33
-3
lines changed
librustdoc/html/static/js
11 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,7 @@ function loadCss(cssUrl) {
563
563
onEachLazy ( code . getElementsByTagName ( "a" ) , elem => {
564
564
const href = elem . getAttribute ( "href" ) ;
565
565
566
- if ( href && href . indexOf ( "http" ) !== 0 ) {
566
+ if ( href && ! / ^ (?: [ a - z + ] + : ) ? \/ \/ / . test ( href ) ) {
567
567
elem . setAttribute ( "href" , window . rootPath + href ) ;
568
568
}
569
569
} ) ;
Original file line number Diff line number Diff line change @@ -33,3 +33,9 @@ goto: "file://" + |DOC_PATH| + "/lib2/trait.TraitToReexport.html"
33
33
assert-count: ("#implementors-list .impl", 1)
34
34
goto: "file://" + |DOC_PATH| + "/implementors/trait.TraitToReexport.html"
35
35
assert-count: ("#implementors-list .impl", 1)
36
+
37
+ // Now check that the link is properly rewritten for a crate called `http`.
38
+ // An older version of rustdoc had a buggy check for absolute links.
39
+ goto: "file://" + |DOC_PATH| + "/http/trait.HttpTrait.html"
40
+ assert-count: ("#implementors-list .impl", 1)
41
+ assert-attribute: ("#implementors-list .impl a.trait", {"href": "../http/trait.HttpTrait.html"})
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ click: "#crate-search"
15
15
press-key: "ArrowDown"
16
16
press-key: "ArrowDown"
17
17
press-key: "ArrowDown"
18
+ press-key: "ArrowDown"
18
19
press-key: "Enter"
19
20
// Waiting for the search results to appear...
20
21
wait-for: "#search-tabs"
@@ -39,6 +40,7 @@ click: "#crate-search"
39
40
press-key: "ArrowUp"
40
41
press-key: "ArrowUp"
41
42
press-key: "ArrowUp"
43
+ press-key: "ArrowUp"
42
44
press-key: "Enter"
43
45
// Waiting for the search results to appear...
44
46
wait-for: "#search-tabs"
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
73
73
// Only "another_folder" should be "open" in "lib2".
74
74
assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
75
75
// All other trees should be collapsed.
76
- assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 7 )
76
+ assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 8 )
77
77
78
78
// We now switch to mobile mode.
79
79
size: (600, 600)
Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ assert: ".source-sidebar-expanded"
102
102
103
103
// We check that the first entry of the sidebar is collapsed
104
104
assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
105
- assert-text: ("#source-sidebar details:first-of-type > summary", "huge_logo ")
105
+ assert-text: ("#source-sidebar details:first-of-type > summary", "http ")
106
106
// We now click on it.
107
107
click: "#source-sidebar details:first-of-type > summary"
108
108
assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})
Original file line number Diff line number Diff line change 2
2
# It is not intended for manual editing.
3
3
version = 3
4
4
5
+ [[package ]]
6
+ name = " http"
7
+ version = " 0.1.0"
8
+
5
9
[[package ]]
6
10
name = " implementors"
7
11
version = " 0.1.0"
12
+ dependencies = [
13
+ " http" ,
14
+ ]
8
15
9
16
[[package ]]
10
17
name = " lib2"
11
18
version = " 0.1.0"
12
19
dependencies = [
20
+ " http" ,
13
21
" implementors" ,
14
22
]
Original file line number Diff line number Diff line change @@ -8,3 +8,4 @@ path = "lib.rs"
8
8
9
9
[dependencies ]
10
10
implementors = { path = " ./implementors" }
11
+ http = { path = " ./http" }
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " http"
3
+ version = " 0.1.0"
4
+ edition = " 2018"
5
+
6
+ [lib ]
7
+ path = " lib.rs"
Original file line number Diff line number Diff line change
1
+ pub trait HttpTrait { }
Original file line number Diff line number Diff line change @@ -5,3 +5,6 @@ edition = "2018"
5
5
6
6
[lib ]
7
7
path = " lib.rs"
8
+
9
+ [dependencies ]
10
+ http = { path = " ../http/" }
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ impl Whatever for Struct {
10
10
type Foo = u8 ;
11
11
}
12
12
13
+ impl http:: HttpTrait for Struct { }
14
+
13
15
mod traits {
14
16
pub trait TraitToReexport {
15
17
fn method ( ) { }
You can’t perform that action at this time.
0 commit comments