about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-03 19:45:30 +0200
committerGitHub <noreply@github.com>2025-07-03 19:45:30 +0200
commit678ec9bbd48d2cb554fb1fccde59ba5e91154b90 (patch)
tree7d9dbbe7499c40b3aa853558aa1b29617d29ece1 /tests
parenta413f77285c0ab551cf58db729e054f43150dd50 (diff)
parent3ed1c87ec159c0b993b45c8f3cfc8c1fe7552e84 (diff)
downloadrust-678ec9bbd48d2cb554fb1fccde59ba5e91154b90.tar.gz
rust-678ec9bbd48d2cb554fb1fccde59ba5e91154b90.zip
Rollup merge of #141831 - lolbinarycat:rustdoc-extern-reexport-135092, r=GuillaumeGomez
rustdoc: fix attrs of locally reexported foreign items

fixes rust-lang/rust#135092

also tweaks a few outdated/misleading comments.

r? `@GuillaumeGomez`
Diffstat (limited to 'tests')
-rw-r--r--tests/rustdoc/reexport/extern-135092.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/rustdoc/reexport/extern-135092.rs b/tests/rustdoc/reexport/extern-135092.rs
new file mode 100644
index 00000000000..fb5c71d56d5
--- /dev/null
+++ b/tests/rustdoc/reexport/extern-135092.rs
@@ -0,0 +1,26 @@
+// Test to make sure reexports of extern items are combined
+// <https://github.com/rust-lang/rust/issues/135092>
+
+#![crate_name = "foo"]
+
+mod native {
+    extern "C" {
+        /// bar.
+        pub fn bar();
+    }
+
+    /// baz.
+    pub fn baz() {}
+}
+
+//@ has 'foo/fn.bar.html'
+//@ has - '//div[@class="docblock"]' 'bar.'
+//@ has - '//div[@class="docblock"]' 'foo'
+/// foo
+pub use native::bar;
+
+//@ has 'foo/fn.baz.html'
+//@ has - '//div[@class="docblock"]' 'baz.'
+//@ has - '//div[@class="docblock"]' 'foo'
+/// foo
+pub use native::baz;