about summary refs log tree commit diff
path: root/tests/rustdoc-json/attrs/non_exhaustive.rs
blob: e4e6c8fd53bac170a592404ea214c088233c8f7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![no_std]

//@ is "$.index[?(@.name=='MyEnum')].attrs" '["non_exhaustive"]'
#[non_exhaustive]
pub enum MyEnum {
    First,
}

pub enum NonExhaustiveVariant {
    //@ is "$.index[?(@.name=='Variant')].attrs" '["non_exhaustive"]'
    #[non_exhaustive]
    Variant(i64),
}

//@ is "$.index[?(@.name=='MyStruct')].attrs" '["non_exhaustive"]'
#[non_exhaustive]
pub struct MyStruct {
    pub x: i64,
}