summaryrefslogtreecommitdiffstats
path: root/tests/ui/deriving/deriving-via-extension-enum.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/deriving/deriving-via-extension-enum.rs')
-rw-r--r--tests/ui/deriving/deriving-via-extension-enum.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/deriving/deriving-via-extension-enum.rs b/tests/ui/deriving/deriving-via-extension-enum.rs
new file mode 100644
index 000000000..6b58fd966
--- /dev/null
+++ b/tests/ui/deriving/deriving-via-extension-enum.rs
@@ -0,0 +1,16 @@
+// run-pass
+#![allow(dead_code)]
+#[derive(PartialEq, Debug)]
+enum Foo {
+ Bar(isize, isize),
+ Baz(f64, f64)
+}
+
+pub fn main() {
+ let a = Foo::Bar(1, 2);
+ let b = Foo::Bar(1, 2);
+ assert_eq!(a, b);
+ assert!(!(a != b));
+ assert!(a.eq(&b));
+ assert!(!a.ne(&b));
+}