Skip to content

Commit 8f4b850

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

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#![deny(rustdoc::broken_intra_doc_links)]
2+
#![crate_name = "tarte"]
3+
4+
/// [tarte]
5+
pub struct Tarte;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Test to ensure that we can link to the current crate by using its name.
2+
//@ aux-build:intra-link-current-crate.rs
3+
//@ build-aux-docs
4+
5+
#![deny(rustdoc::broken_intra_doc_links)]
6+
#![crate_name = "bar"]
7+
8+
//@ has 'bar/index.html'
9+
//@ has - '//*[@class="docblock"]//a[@href="index.html"]' 'bar'
10+
//! [`bar`]
11+
12+
extern crate tarte;
13+
14+
//@ has 'bar/struct.Tarte.html'
15+
//@ has - '//*[@class="docblock"]//a[@href="../tarte/index.html"]' 'tarte'
16+
#[doc(inline)]
17+
pub use tarte::Tarte;
18+
19+
pub mod foo {
20+
//@ has 'bar/foo/fn.tadam.html'
21+
//@ has - '//*[@class="docblock"]//a[@href="../index.html"]' 'bar'
22+
/// [`bar`]
23+
pub fn tadam() {}
24+
}

0 commit comments

Comments
 (0)