Skip to content

Commit 200dd77

Browse files
Add regression test for current crate intra-doc link
1 parent 07bcd4b commit 200dd77

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Test to ensure that we can link to the current crate by using its name.
2+
3+
#![deny(rustdoc::broken_intra_doc_links)]
4+
#![crate_name = "bar"]
5+
6+
//@ has 'bar/index.html'
7+
//@ has - '//*[@class="docblock"]//a[@href="index.html"]' 'bar'
8+
//! [`bar`]
9+
10+
pub mod foo {
11+
//@ has 'bar/foo/fn.tadam.html'
12+
//@ has - '//*[@class="docblock"]//a[@href="../index.html"]' 'bar'
13+
/// [`bar`]
14+
pub fn tadam() {}
15+
}

0 commit comments

Comments
 (0)