1
Fork 0
rust/src/test/ui/deriving/deriving-default-enum.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
271 B
Rust
Raw Normal View History

// 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);
}