summaryrefslogtreecommitdiffstats
path: root/src/test/ui/deriving/issue-103157.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/deriving/issue-103157.rs')
-rw-r--r--src/test/ui/deriving/issue-103157.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/deriving/issue-103157.rs b/src/test/ui/deriving/issue-103157.rs
new file mode 100644
index 000000000..52b4c7898
--- /dev/null
+++ b/src/test/ui/deriving/issue-103157.rs
@@ -0,0 +1,12 @@
+// check-fail
+
+#[derive(PartialEq, Eq)]
+pub enum Value {
+ Boolean(Option<bool>),
+ Float(Option<f64>), //~ ERROR the trait bound `f64: Eq` is not satisfied
+}
+
+fn main() {
+ let a = Value::Float(Some(f64::NAN));
+ assert!(a == a);
+}