diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-02-20 00:37:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-20 00:37:24 +0100 |
| commit | 1ae00e0b935f7f3fa353bb4a6443aebc70172c98 (patch) | |
| tree | 38f891e34d4be80d1179e28979c9d5ed099ec08e /src/test/rustdoc-gui | |
| parent | 575f6c5cc1779508cd30847ccb9f3f489f5e6c00 (diff) | |
| parent | d9ea7bc98d760b1bfabf192bbadf7e73df0ade68 (diff) | |
Rollup merge of #94002 - GuillaumeGomez:duplicated-sidebar-macro, r=notriddle
rustdoc: Avoid duplicating macros in sidebar Fixes #93912. cc ``````@jsha`````` (for the GUI test) r? ``````@camelid``````
Diffstat (limited to 'src/test/rustdoc-gui')
| -rw-r--r-- | src/test/rustdoc-gui/duplicate-macro-reexport.goml | 14 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/test_docs/lib.rs | 3 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/test_docs/macros.rs | 4 |
3 files changed, 21 insertions, 0 deletions
diff --git a/src/test/rustdoc-gui/duplicate-macro-reexport.goml b/src/test/rustdoc-gui/duplicate-macro-reexport.goml new file mode 100644 index 00000000000..c79b3a220c4 --- /dev/null +++ b/src/test/rustdoc-gui/duplicate-macro-reexport.goml @@ -0,0 +1,14 @@ +// This test ensures that there is no macro duplicates in the sidebar. +goto: file://|DOC_PATH|/test_docs/macro.a.html +// Waiting for the elements in the sidebar to be rendered. +wait-for: ".sidebar-elems .others .macro" +// Check there is only one macro named "a" listed in the sidebar. +assert-count: ( + "//*[@class='sidebar-elems']//*[@class='others']/*[@class='block macro']//li/a[text()='a']", + 1, +) +// Check there is only one macro named "b" listed in the sidebar. +assert-count: ( + "//*[@class='sidebar-elems']//*[@class='others']/*[@class='block macro']//li/a[text()='b']", + 1, +) diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 2068d1d6f39..348b1a65c78 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -271,3 +271,6 @@ impl EmptyTrait1 for HasEmptyTraits {} impl EmptyTrait2 for HasEmptyTraits {} #[doc(cfg(feature = "some-feature"))] impl EmptyTrait3 for HasEmptyTraits {} + +mod macros; +pub use macros::*; diff --git a/src/test/rustdoc-gui/src/test_docs/macros.rs b/src/test/rustdoc-gui/src/test_docs/macros.rs new file mode 100644 index 00000000000..07b2b97926d --- /dev/null +++ b/src/test/rustdoc-gui/src/test_docs/macros.rs @@ -0,0 +1,4 @@ +#[macro_export] +macro_rules! a{ () => {}} +#[macro_export] +macro_rules! b{ () => {}} |
