diff --git a/src/test/rustdoc-ui/issue-79764/a/another_mod.rs b/src/test/rustdoc-ui/issue-79764/a/another_mod.rs new file mode 100644 index 0000000000000..a41150798826e --- /dev/null +++ b/src/test/rustdoc-ui/issue-79764/a/another_mod.rs @@ -0,0 +1,4 @@ +//! ``` +//! // ^ a/another_mod.rs line 1 +//! assert_eq!(1, 1); +//! ``` diff --git a/src/test/rustdoc-ui/issue-79764/a/compiletest-ignore-dir b/src/test/rustdoc-ui/issue-79764/a/compiletest-ignore-dir new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/src/test/rustdoc-ui/issue-79764/a/mod.rs b/src/test/rustdoc-ui/issue-79764/a/mod.rs new file mode 100644 index 0000000000000..f8541dec7c8d6 --- /dev/null +++ b/src/test/rustdoc-ui/issue-79764/a/mod.rs @@ -0,0 +1,10 @@ +//! ``` +//! // ^ a/mod.rs line 1 +//! assert_eq!(1, 1); +//! ``` + +/// ``` +/// // ^ a/mod.rs line 6 +/// assert_eq!(1, 1); +/// ``` +pub mod another_mod; diff --git a/src/test/rustdoc-ui/issue-79764/mod.rs b/src/test/rustdoc-ui/issue-79764/mod.rs new file mode 100644 index 0000000000000..6e161d4c0c19c --- /dev/null +++ b/src/test/rustdoc-ui/issue-79764/mod.rs @@ -0,0 +1,14 @@ +// check-pass +// compile-flags:--test +// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" +// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" + +// The literal `mod` in the doctest comments makes rustdoc emit a bogus +// `extern crate mod;` line which would break the doctests. +#![doc(test(no_crate_inject))] + +/// ``` +/// // ^ mod.rs line 10 +/// assert_eq!(1, 1); +/// ``` +pub mod a; diff --git a/src/test/rustdoc-ui/issue-79764/mod.stdout b/src/test/rustdoc-ui/issue-79764/mod.stdout new file mode 100644 index 0000000000000..b9f5bd22fc300 --- /dev/null +++ b/src/test/rustdoc-ui/issue-79764/mod.stdout @@ -0,0 +1,9 @@ + +running 4 tests +test $DIR/issue-79764/mod.rs - a (line 14) ... ok +test $DIR/issue-79764/mod.rs - a (line 10) ... ok +test $DIR/issue-79764/a/mod.rs - a::another_mod (line 6) ... ok +test $DIR/issue-79764/a/mod.rs - a::another_mod (line 10) ... ok + +test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME +