Add test for re-exports
I had a hard time getting this to work without the `extern crate`, suggestions are welcome.
This commit is contained in:
parent
99f34d814e
commit
e78d499637
3 changed files with 28 additions and 0 deletions
12
src/test/rustdoc/intra-doc-crate/auxiliary/submodule.rs
Normal file
12
src/test/rustdoc/intra-doc-crate/auxiliary/submodule.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#![crate_name = "bar"]
|
||||
|
||||
pub trait Foo {
|
||||
/// [`Bar`] [`Baz`]
|
||||
fn foo();
|
||||
}
|
||||
|
||||
pub trait Bar {
|
||||
}
|
||||
|
||||
pub trait Baz {
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
// aux-build:intra-doc-basic.rs
|
||||
// build-aux-docs
|
||||
|
||||
// from https://github.com/rust-lang/rust/issues/65983
|
||||
extern crate a;
|
||||
|
||||
// @has 'basic/struct.Bar.html' '//a[@href="../a/struct.Foo.html"]' 'Foo'
|
||||
|
|
|
|||
14
src/test/rustdoc/intra-doc-crate/submodule.rs
Normal file
14
src/test/rustdoc/intra-doc-crate/submodule.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// aux-build:submodule.rs
|
||||
// edition:2018
|
||||
extern crate bar as bar_;
|
||||
|
||||
// from https://github.com/rust-lang/rust/issues/60883
|
||||
pub mod bar {
|
||||
pub use ::bar_::Bar;
|
||||
}
|
||||
|
||||
// NOTE: we re-exported both `Foo` and `Bar` here,
|
||||
// NOTE: so they are inlined and therefore we link to the current module.
|
||||
// @has 'submodule/trait.Foo.html' '//a[@href="../submodule/bar/trait.Bar.html"]' 'Bar'
|
||||
// @has 'submodule/trait.Foo.html' '//a[@href="../submodule/trait.Baz.html"]' 'Baz'
|
||||
pub use ::bar_::{Foo, Baz};
|
||||
Loading…
Add table
Add a link
Reference in a new issue