diff options
Diffstat (limited to 'src/test/ui/deriving/deriving-default-enum.rs')
-rw-r--r-- | src/test/ui/deriving/deriving-default-enum.rs | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/test/ui/deriving/deriving-default-enum.rs b/src/test/ui/deriving/deriving-default-enum.rs deleted file mode 100644 index 1c7a501ed..000000000 --- a/src/test/ui/deriving/deriving-default-enum.rs +++ /dev/null @@ -1,27 +0,0 @@ -// 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), -} - -// #[default] on a generic enum does not add `Default` bounds to the type params. -#[derive(Default)] -enum MyOption<T> { - #[default] - None, - #[allow(dead_code)] - Some(T), -} - -fn main() { - assert_eq!(Foo::default(), Foo::Alpha); - assert!(matches!(MyOption::<NotDefault>::default(), MyOption::None)); -} |