summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-json/impls
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs15
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs14
-rw-r--r--tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs21
3 files changed, 50 insertions, 0 deletions
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
new file mode 100644
index 000000000..d2ac316d4
--- /dev/null
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-2.rs
@@ -0,0 +1,15 @@
+#![feature(no_core)]
+#![no_core]
+
+// @count "$.index[*][?(@.inner.impl)]" 1
+// @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
+// @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
+// @has "$.index[*][?(@.name=='PubTrait')]"
+pub trait PubTrait {}
+
+#[doc(hidden)]
+pub struct HiddenPubStruct;
+pub struct NotHiddenPubStruct;
+
+impl PubTrait for HiddenPubStruct {}
+impl PubTrait for NotHiddenPubStruct {}
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
new file mode 100644
index 000000000..fcd27ca4b
--- /dev/null
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id-3.rs
@@ -0,0 +1,14 @@
+// compile-flags: --document-hidden-items
+
+#![feature(no_core)]
+#![no_core]
+
+// @has "$.index[*][?(@.name == 'HiddenPubStruct')]"
+// @has "$.index[*][?(@.inner.impl)]"
+// @has "$.index[*][?(@.name=='PubTrait')]"
+pub trait PubTrait {}
+
+#[doc(hidden)]
+pub struct HiddenPubStruct;
+
+impl PubTrait for HiddenPubStruct {}
diff --git a/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
new file mode 100644
index 000000000..141c54a57
--- /dev/null
+++ b/tests/rustdoc-json/impls/issue-112852-dangling-trait-impl-id.rs
@@ -0,0 +1,21 @@
+#![feature(no_core)]
+#![no_core]
+
+// @count "$.index[*][?(@.inner.impl)]" 1
+// @!has "$.index[*][?(@.name == 'HiddenPubStruct')]"
+// @has "$.index[*][?(@.name == 'NotHiddenPubStruct')]"
+// @has "$.index[*][?(@.name=='PubTrait')]"
+pub trait PubTrait {}
+
+#[doc(hidden)]
+pub mod hidden {
+ pub struct HiddenPubStruct;
+
+ impl crate::PubTrait for HiddenPubStruct {}
+}
+
+pub mod not_hidden {
+ pub struct NotHiddenPubStruct;
+
+ impl crate::PubTrait for NotHiddenPubStruct {}
+}