mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-26 13:54:06 +00:00
Add test for submodules in inner crate
This commit is contained in:
parent
9eb63945eb
commit
71fe8f7cd8
@ -0,0 +1,11 @@
|
||||
#![crate_name = "a"]
|
||||
|
||||
pub mod bar {
|
||||
pub struct Bar;
|
||||
}
|
||||
|
||||
pub mod foo {
|
||||
use crate::bar;
|
||||
/// link to [bar::Bar]
|
||||
pub struct Foo;
|
||||
}
|
6
src/test/rustdoc/intra-doc-crate/submodule-inner.rs
Normal file
6
src/test/rustdoc/intra-doc-crate/submodule-inner.rs
Normal file
@ -0,0 +1,6 @@
|
||||
// aux-build:submodule-inner.rs
|
||||
// build-aux-docs
|
||||
extern crate a;
|
||||
|
||||
// @has 'submodule_inner/struct.Foo.html' '//a[@href="../a/bar/struct.Bar.html"]' 'Bar'
|
||||
pub use a::foo::Foo;
|
@ -1,4 +1,4 @@
|
||||
// aux-build:submodule.rs
|
||||
// aux-build:submodule-outer.rs
|
||||
// edition:2018
|
||||
extern crate bar as bar_;
|
||||
|
||||
@ -9,6 +9,6 @@ pub mod 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'
|
||||
// @has 'submodule_outer/trait.Foo.html' '//a[@href="../submodule_outer/bar/trait.Bar.html"]' 'Bar'
|
||||
// @has 'submodule_outer/trait.Foo.html' '//a[@href="../submodule_outer/trait.Baz.html"]' 'Baz'
|
||||
pub use ::bar_::{Foo, Baz};
|
Loading…
Reference in New Issue
Block a user