about summary refs log tree commit diff
path: root/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs')
-rw-r--r--tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs b/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
new file mode 100644
index 00000000000..4e461d3bc37
--- /dev/null
+++ b/tests/rustdoc/inline_cross/auxiliary/rustdoc-nonreachable-impls.rs
@@ -0,0 +1,34 @@
+pub struct Foo;
+
+pub trait Woof {}
+pub trait Bark {}
+
+mod private {
+    // should be shown
+    impl ::Woof for ::Foo {}
+
+    pub trait Bar {}
+    pub struct Wibble;
+
+    // these should not be shown
+    impl Bar for ::Foo {}
+    impl Bar for Wibble {}
+    impl ::Bark for Wibble {}
+    impl ::Woof for Wibble {}
+}
+
+#[doc(hidden)]
+pub mod hidden {
+    // should be shown
+    impl ::Bark for ::Foo {}
+
+    pub trait Qux {}
+    pub struct Wobble;
+
+
+    // these should only be shown if they're re-exported correctly
+    impl Qux for ::Foo {}
+    impl Qux for Wobble {}
+    impl ::Bark for Wobble {}
+    impl ::Woof for Wobble {}
+}