about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/auxiliary/non-exhaustive-enum.rs
blob: e3205193ccea021432800991cdaed6c2811823c8 (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
// Stripped down version of the ErrorKind enum of std
#[non_exhaustive]
pub enum ErrorKind {
    NotFound,
    PermissionDenied,
    #[doc(hidden)]
    Uncategorized,
}

#[non_exhaustive]
pub enum ExtNonExhaustiveEnum {
    Unit,
    Tuple(i32),
    Struct { field: i32 },
}

pub enum ExtNonExhaustiveVariant {
    ExhaustiveUnit,
    #[non_exhaustive]
    Unit,
    #[non_exhaustive]
    Tuple(i32),
    #[non_exhaustive]
    StructNoField {},
    #[non_exhaustive]
    Struct {
        field: i32,
    },
}