about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2018-04-11 16:25:34 +0100
committervarkor <github@varkor.com>2018-04-11 16:25:34 +0100
commit5fa157a2d4e147f8bff3d244940dccfe80680081 (patch)
treebcdfba9facd125d9a0d8d3be08324f3695b300bf
parent1ce06d09328c17a59cb8b02d12811d694b89662e (diff)
downloadrust-5fa157a2d4e147f8bff3d244940dccfe80680081.tar.gz
rust-5fa157a2d4e147f8bff3d244940dccfe80680081.zip
Add test for derive(PartialOrd) correctness
-rw-r--r--src/test/run-pass/derive-partialord-correctness.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-pass/derive-partialord-correctness.rs b/src/test/run-pass/derive-partialord-correctness.rs
new file mode 100644
index 00000000000..bc9e9a70087
--- /dev/null
+++ b/src/test/run-pass/derive-partialord-correctness.rs
@@ -0,0 +1,18 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Original issue: #49650
+
+#[derive(PartialOrd, PartialEq)]
+struct FloatWrapper(f64);
+
+fn main() {
+    assert!((0.0 / 0.0 >= 0.0) == (FloatWrapper(0.0 / 0.0) >= FloatWrapper(0.0)))
+}