summaryrefslogtreecommitdiffstats
path: root/src/test/ui/deriving/deriving-default-enum.rs
blob: d1a81c72c2fdcc0c2112daf7efb08249ee5dd8de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass

// nb: does not impl Default
#[derive(Debug, PartialEq)]
struct NotDefault;

#[derive(Debug, Default, PartialEq)]
enum Foo {
    #[default]
    Alpha,
    #[allow(dead_code)]
    Beta(NotDefault),
}

fn main() {
    assert_eq!(Foo::default(), Foo::Alpha);
}