rustdoc: Fix re-exporting primitive types
* Generate links to the primitive type docs for re-exports. * Don't ICE on cross crate primitive type re-exports. * Make primitive type re-exports show up cross crate.
This commit is contained in:
parent
80a65bcaf2
commit
bbc2ae7590
6 changed files with 91 additions and 17 deletions
8
src/test/rustdoc/auxiliary/primitive-reexport.rs
Normal file
8
src/test/rustdoc/auxiliary/primitive-reexport.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// compile-flags: --emit metadata --crate-type lib --edition 2018
|
||||
|
||||
#![crate_name = "foo"]
|
||||
|
||||
pub mod bar {
|
||||
pub use bool;
|
||||
pub use char as my_char;
|
||||
}
|
||||
28
src/test/rustdoc/primitive-reexport.rs
Normal file
28
src/test/rustdoc/primitive-reexport.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// aux-build: primitive-reexport.rs
|
||||
// compile-flags:--extern foo --edition 2018
|
||||
|
||||
#![crate_name = "bar"]
|
||||
|
||||
// @has bar/p/index.html
|
||||
// @has - '//code' 'pub use bool;'
|
||||
// @has - '//code/a[@href="https://doc.rust-lang.org/nightly/std/primitive.bool.html"]' 'bool'
|
||||
// @has - '//code' 'pub use char as my_char;'
|
||||
// @has - '//code/a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html"]' 'char'
|
||||
pub mod p {
|
||||
pub use foo::bar::*;
|
||||
}
|
||||
|
||||
// @has bar/baz/index.html
|
||||
// @has - '//code' 'pub use bool;'
|
||||
// @has - '//code/a[@href="https://doc.rust-lang.org/nightly/std/primitive.bool.html"]' 'bool'
|
||||
// @has - '//code' 'pub use char as my_char;'
|
||||
// @has - '//code/a[@href="https://doc.rust-lang.org/nightly/std/primitive.char.html"]' 'char'
|
||||
pub use foo::bar as baz;
|
||||
|
||||
// @has bar/index.html
|
||||
// @has - '//code' 'pub use str;'
|
||||
// @has - '//code/a[@href="https://doc.rust-lang.org/nightly/std/primitive.str.html"]' 'str'
|
||||
// @has - '//code' 'pub use i32 as my_i32;'
|
||||
// @has - '//code/a[@href="https://doc.rust-lang.org/nightly/std/primitive.i32.html"]' 'i32'
|
||||
pub use str;
|
||||
pub use i32 as my_i32;
|
||||
Loading…
Add table
Add a link
Reference in a new issue