summaryrefslogtreecommitdiffstats
path: root/src/test/rustdoc-json/assoc_items.rs
blob: 6d7f6bb969fb1b9d0b68e241a8490d8ce1b84576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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;
}