Skip to content

Commit 38a2a3d

Browse files
committed
rustdoc: test for loading index when user said no
Also mentioned, as a perf problem, in <rust-lang/cargo#16309 (comment)>
1 parent fb3a089 commit 38a2a3d

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

tests/run-make/rustdoc-merge-directory-alias/dep1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ pub struct Dep4;
66
//@ hasraw crates.js 'dep1'
77
//@ hasraw search.index/name/*.js 'Dep1'
88
//@ has dep1/index.html
9-
#[doc(alias="dep1_missing")]
9+
#[doc(alias = "dep1_missing")]
1010
pub struct Dep5;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
//@ !hasraw crates.js 'dep_missing'
2+
//@ !hasraw search.index/name/*.js 'DepMissing'
3+
//@ has dep_missing/index.html
4+
pub struct DepMissing;

tests/run-make/rustdoc-merge-directory-alias/rmake.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,28 @@ fn main() {
6161
.run();
6262
output3.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
6363

64+
// dep_missing is different, because --parts-out-dir is not supplied
65+
rustdoc().input("dep_missing.rs").out_dir(&out_dir).run();
66+
assert!(parts_out_dir.join("dep2.json").exists());
67+
68+
rustdoc()
69+
.input("dep1.rs")
70+
.out_dir(&out_dir)
71+
.arg("-Zunstable-options")
72+
.arg(format!("--parts-out-dir={}", parts_out_dir.display()))
73+
.arg("--merge=none")
74+
.run();
75+
assert!(parts_out_dir.join("dep1.json").exists());
76+
77+
let output4 = rustdoc()
78+
.arg("-Zunstable-options")
79+
.out_dir(&out_dir)
80+
.arg(format!("--include-parts-dir={}", parts_out_dir.display()))
81+
.arg("--merge=finalize")
82+
.run();
83+
output4.assert_stderr_not_contains("error: the compiler unexpectedly panicked. this is a bug.");
84+
6485
htmldocck().arg(&out_dir).arg("dep1.rs").run();
6586
htmldocck().arg(&out_dir).arg("dep2.rs").run();
87+
htmldocck().arg(&out_dir).arg("dep_missing.rs").run();
6688
}

0 commit comments

Comments
 (0)