about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-10-19 05:40:51 +0200
committerGitHub <noreply@github.com>2021-10-19 05:40:51 +0200
commit0d990a3dbd7733a05c5ccdb99c123fac8938dcc6 (patch)
tree619a2d3d57669a78fc72b72d073df8391526b123 /src/test/rustdoc
parent54aa5477ac081e5675fdd29565ae0d27ffd13cab (diff)
parentdb5b64a484dbea09f1f39e0640662b50c6e934cd (diff)
downloadrust-0d990a3dbd7733a05c5ccdb99c123fac8938dcc6.tar.gz
rust-0d990a3dbd7733a05c5ccdb99c123fac8938dcc6.zip
Rollup merge of #89867 - Urgau:fix-double-definition, r=GuillaumeGomez
Fix macro_rules! duplication when reexported in the same module

This can append if within the same module a `#[macro_export] macro_rules!`
is declared but also a reexport of itself producing two export of the same
macro in the same module. In that case we only want to document it once.

Before:
```
Module {
    is_crate: true,
    items: [
        Id("0:4"),   // pub use crate::repro as repro2;
        Id("0:3"),   // macro_rules! repro
        Id("0:3"),   // duplicate, same as above
    ],
}
```

After:
```
Module {
    is_crate: true,
    items: [
        Id("0:4"),   // pub use crate::repro as repro2;
        Id("0:3"),   // macro_rules! repro
    ],
}
```

Fixes https://github.com/rust-lang/rust/issues/89852
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/issue-89852.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/rustdoc/issue-89852.rs b/src/test/rustdoc/issue-89852.rs
new file mode 100644
index 00000000000..45544dbeea6
--- /dev/null
+++ b/src/test/rustdoc/issue-89852.rs
@@ -0,0 +1,14 @@
+// edition:2018
+
+#![no_core]
+#![feature(no_core)]
+
+// @matches 'issue_89852/sidebar-items.js' '"repro"'
+// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
+
+#[macro_export]
+macro_rules! repro {
+    () => {};
+}
+
+pub use crate::repro as repro2;