Skip to content

Commit e78d499

Browse files
committed
Add test for re-exports
I had a hard time getting this to work without the `extern crate`, suggestions are welcome.
1 parent 99f34d8 commit e78d499

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![crate_name = "bar"]
2+
3+
pub trait Foo {
4+
/// [`Bar`] [`Baz`]
5+
fn foo();
6+
}
7+
8+
pub trait Bar {
9+
}
10+
11+
pub trait Baz {
12+
}

src/test/rustdoc/intra-doc-crate/basic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// aux-build:intra-doc-basic.rs
22
// build-aux-docs
3+
4+
// from https://github.com/rust-lang/rust/issues/65983
35
extern crate a;
46

57
// @has 'basic/struct.Bar.html' '//a[@href="../a/struct.Foo.html"]' 'Foo'
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// aux-build:submodule.rs
2+
// edition:2018
3+
extern crate bar as bar_;
4+
5+
// from https://github.com/rust-lang/rust/issues/60883
6+
pub mod bar {
7+
pub use ::bar_::Bar;
8+
}
9+
10+
// NOTE: we re-exported both `Foo` and `Bar` here,
11+
// NOTE: so they are inlined and therefore we link to the current module.
12+
// @has 'submodule/trait.Foo.html' '//a[@href="../submodule/bar/trait.Bar.html"]' 'Bar'
13+
// @has 'submodule/trait.Foo.html' '//a[@href="../submodule/trait.Baz.html"]' 'Baz'
14+
pub use ::bar_::{Foo, Baz};

0 commit comments

Comments
 (0)