diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:29 +0000 |
commit | 631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch) | |
tree | a1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/rustdoc/issue-108679-reexport-of-reexport.rs | |
parent | Adding debian version 1.69.0+dfsg1-1. (diff) | |
download | rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc/issue-108679-reexport-of-reexport.rs')
-rw-r--r-- | tests/rustdoc/issue-108679-reexport-of-reexport.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/rustdoc/issue-108679-reexport-of-reexport.rs b/tests/rustdoc/issue-108679-reexport-of-reexport.rs new file mode 100644 index 000000000..5f977801c --- /dev/null +++ b/tests/rustdoc/issue-108679-reexport-of-reexport.rs @@ -0,0 +1,29 @@ +// This test ensures that the `struct.B.html` only exists in `a`: +// since `a::B` is public (and inlined too), `self::a::B` doesn't +// need to be inlined as well. + +#![crate_name = "foo"] + +pub mod a { + // @has 'foo/a/index.html' + // Should only contain "Structs". + // @count - '//*[@id="main-content"]//*[@class="item-table"]' 1 + // @has - '//*[@id="structs"]' 'Structs' + // @has - '//*[@id="main-content"]//a[@href="struct.A.html"]' 'A' + // @has - '//*[@id="main-content"]//a[@href="struct.B.html"]' 'B' + mod b { + pub struct B; + } + pub use self::b::B; + pub struct A; +} + +// @has 'foo/index.html' +// @!has - '//*[@id="structs"]' 'Structs' +// @has - '//*[@id="reexports"]' 'Re-exports' +// @has - '//*[@id="modules"]' 'Modules' +// @has - '//*[@id="main-content"]//*[@id="reexport.A"]' 'pub use self::a::A;' +// @has - '//*[@id="main-content"]//*[@id="reexport.B"]' 'pub use self::a::B;' +// Should only contain "Modules" and "Re-exports". +// @count - '//*[@id="main-content"]//*[@class="item-table"]' 2 +pub use self::a::{A, B}; |