about summary refs log tree commit diff
path: root/tests/rustdoc-json/assoc_items.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-json/assoc_items.rs
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'tests/rustdoc-json/assoc_items.rs')
-rw-r--r--tests/rustdoc-json/assoc_items.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/rustdoc-json/assoc_items.rs b/tests/rustdoc-json/assoc_items.rs
new file mode 100644
index 00000000000..6d7f6bb969f
--- /dev/null
+++ b/tests/rustdoc-json/assoc_items.rs
@@ -0,0 +1,37 @@
+#![no_std]
+
+pub struct Simple;
+
+impl Simple {
+    // @is "$.index[*][?(@.name=='CONSTANT')].kind" \"assoc_const\"
+    pub const CONSTANT: usize = 0;
+}
+
+pub trait EasyToImpl {
+    // @is "$.index[*][?(@.docs=='ToDeclare trait')].kind" \"assoc_type\"
+    // @is "$.index[*][?(@.docs=='ToDeclare trait')].inner.default" null
+    // @is "$.index[*][?(@.docs=='ToDeclare trait')].inner.bounds" []
+    /// ToDeclare trait
+    type ToDeclare;
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].kind" \"assoc_const\"
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.default" null
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.type.kind" '"primitive"'
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE trait')].inner.type.inner" '"usize"'
+    /// AN_ATTRIBUTE trait
+    const AN_ATTRIBUTE: usize;
+}
+
+impl EasyToImpl for Simple {
+    // @is "$.index[*][?(@.docs=='ToDeclare impl')].kind" '"assoc_type"'
+    // @is "$.index[*][?(@.docs=='ToDeclare impl')].inner.default.kind" \"primitive\"
+    // @is "$.index[*][?(@.docs=='ToDeclare impl')].inner.default.inner" \"usize\"
+    /// ToDeclare impl
+    type ToDeclare = usize;
+
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].kind" '"assoc_const"'
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.type.kind" \"primitive\"
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.type.inner" \"usize\"
+    // @is "$.index[*][?(@.docs=='AN_ATTRIBUTE impl')].inner.default" \"12\"
+    /// AN_ATTRIBUTE impl
+    const AN_ATTRIBUTE: usize = 12;
+}