about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeihang Lo <me@weihanglo.tw>2025-09-02 18:30:16 -0400
committerWeihang Lo <me@weihanglo.tw>2025-09-02 18:30:20 -0400
commit43873db3b31b46280287d0797679f04d1407ddee (patch)
tree909c2b3f3b6db16049fb7f68b4990369ac5e956f
parenta2c8b0b92c14b02f0b3f96a0d5296f1090dc286b (diff)
downloadrust-43873db3b31b46280287d0797679f04d1407ddee.tar.gz
rust-43873db3b31b46280287d0797679f04d1407ddee.zip
test(rustdoc): show the wrong `--emit` precedence
It should have the same behavior as rustc, which the last wins.
-rw-r--r--tests/run-make/rustdoc-dep-info/rmake.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/run-make/rustdoc-dep-info/rmake.rs b/tests/run-make/rustdoc-dep-info/rmake.rs
index 625f81fd428..956809909d9 100644
--- a/tests/run-make/rustdoc-dep-info/rmake.rs
+++ b/tests/run-make/rustdoc-dep-info/rmake.rs
@@ -33,4 +33,17 @@ fn main() {
     // Now we check that we can provide a file name to the `dep-info` argument.
     rustdoc().input("lib.rs").arg("-Zunstable-options").emit("dep-info=bla.d").run();
     assert!(path("bla.d").exists());
+
+    // The last emit-type wins. The same behavior as rustc.
+    // TODO: this shows the wrong behavior as a MRE, which will be fixed in the next commit
+    rustdoc()
+        .input("lib.rs")
+        .arg("-Zunstable-options")
+        .emit("dep-info=precedence1.d")
+        .emit("dep-info=precedence2.d")
+        .emit("dep-info=precedence3.d")
+        .run();
+    assert!(path("precedence1.d").exists());
+    assert!(!path("precedence2.d").exists());
+    assert!(!path("precedence3.d").exists());
 }