summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-json/impls
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/rustdoc-json/impls
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json/impls')
-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 {}
+}