diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/rustdoc-json/assoc_items.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-json/assoc_items.rs')
-rw-r--r-- | tests/rustdoc-json/assoc_items.rs | 37 |
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 000000000..6d7f6bb96 --- /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; +} |