about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2021-12-16 22:11:17 -0800
committerDylan MacKenzie <ecstaticmorse@gmail.com>2021-12-16 22:11:17 -0800
commit20492870307feae4ca57acdca75bcc8ea06fe175 (patch)
treeed19088eed551ee21b9c454bc04ea7a9801db8df
parent1606335a93a2c0ab218ffc1c776ed7ddd9515520 (diff)
downloadrust-20492870307feae4ca57acdca75bcc8ea06fe175.tar.gz
rust-20492870307feae4ca57acdca75bcc8ea06fe175.zip
Disable test on bootstrap compiler
-rw-r--r--library/core/tests/cmp.rs45
1 files changed, 25 insertions, 20 deletions
diff --git a/library/core/tests/cmp.rs b/library/core/tests/cmp.rs
index c9d29ed3a83..58fee19ca74 100644
--- a/library/core/tests/cmp.rs
+++ b/library/core/tests/cmp.rs
@@ -204,30 +204,35 @@ fn cmp_default() {
     assert_eq!(Fool(false), Fool(true));
 }
 
-struct S(i32);
+#[cfg(not(bootstrap))]
+mod const_cmp {
+    use super::*;
 
-impl const PartialEq for S {
-    fn eq(&self, other: &Self) -> bool {
-        self.0 == other.0
+    struct S(i32);
+
+    impl const PartialEq for S {
+        fn eq(&self, other: &Self) -> bool {
+            self.0 == other.0
+        }
     }
-}
 
-impl const PartialOrd for S {
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
-        let ret = match (self.0, other.0) {
-            (a, b) if a > b => Ordering::Greater,
-            (a, b) if a < b => Ordering::Less,
-            _ => Ordering::Equal,
-        };
+    impl const PartialOrd for S {
+        fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
+            let ret = match (self.0, other.0) {
+                (a, b) if a > b => Ordering::Greater,
+                (a, b) if a < b => Ordering::Less,
+                _ => Ordering::Equal,
+            };
 
-        Some(ret)
+            Some(ret)
+        }
     }
-}
 
-const _: () = assert!(S(1) == S(1));
-const _: () = assert!(S(0) != S(1));
+    const _: () = assert!(S(1) == S(1));
+    const _: () = assert!(S(0) != S(1));
 
-const _: () = assert!(S(1) <= S(1));
-const _: () = assert!(S(1) >= S(1));
-const _: () = assert!(S(0) <  S(1));
-const _: () = assert!(S(1) >  S(0));
+    const _: () = assert!(S(1) <= S(1));
+    const _: () = assert!(S(1) >= S(1));
+    const _: () = assert!(S(0) < S(1));
+    const _: () = assert!(S(1) > S(0));
+}