Skip to content

Commit 81d86bf

Browse files
committed
Add regression test for remap-path-prefix handling in rustdoc for deps
1 parent 1d8f9c5 commit 81d86bf

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ compile-flags:-Zunstable-options --remap-path-prefix={{src-base}}=
2+
3+
pub struct MyStruct {
4+
field: u32,
5+
}
6+
7+
impl MyStruct {
8+
pub fn new() -> MyStruct {
9+
MyStruct { field: 3 }
10+
}
11+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// This is a regression for `--remap-path-prefix` in an auxiliary dependency.
2+
//
3+
// We want to make sure that we can still have the "Source" links to the dependency
4+
// even if it's paths are remapped.
5+
//
6+
// See also rust-lang/rust#150100
7+
8+
//@ aux-build:remapped-paths.rs
9+
//@ build-aux-docs
10+
11+
#![crate_name = "foo"]
12+
13+
extern crate remapped_paths;
14+
15+
//@ has foo/struct.MyStruct.html
16+
// FIXME: Doesn't work!
17+
//@ has - '//a[@href="../src/remapped_paths/remapped-paths.rs.html#3"]' 'Source'
18+
//@ has - '//a[@href="../src/remapped_paths/remapped-paths.rs.html#8"]' 'Source'
19+
20+
pub use remapped_paths::MyStruct;

0 commit comments

Comments
 (0)