diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/deriving/deriving-cmp-generic-tuple-struct.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/deriving/deriving-cmp-generic-tuple-struct.rs')
-rw-r--r-- | src/test/ui/deriving/deriving-cmp-generic-tuple-struct.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/test/ui/deriving/deriving-cmp-generic-tuple-struct.rs b/src/test/ui/deriving/deriving-cmp-generic-tuple-struct.rs deleted file mode 100644 index 79f58d456..000000000 --- a/src/test/ui/deriving/deriving-cmp-generic-tuple-struct.rs +++ /dev/null @@ -1,38 +0,0 @@ -// run-pass -#[derive(PartialEq, Eq, PartialOrd, Ord)] -struct TS<T>(T,T); - - -pub fn main() { - let ts1 = TS(1, 1); - let ts2 = TS(1, 2); - - // in order for both PartialOrd and Ord - let tss = [ts1, ts2]; - - for (i, ts1) in tss.iter().enumerate() { - for (j, ts2) in tss.iter().enumerate() { - let ord = i.cmp(&j); - - let eq = i == j; - let lt = i < j; - let le = i <= j; - let gt = i > j; - let ge = i >= j; - - // PartialEq - assert_eq!(*ts1 == *ts2, eq); - assert_eq!(*ts1 != *ts2, !eq); - - // PartialOrd - assert_eq!(*ts1 < *ts2, lt); - assert_eq!(*ts1 > *ts2, gt); - - assert_eq!(*ts1 <= *ts2, le); - assert_eq!(*ts1 >= *ts2, ge); - - // Ord - assert_eq!(ts1.cmp(ts2), ord); - } - } -} |