Skip to content

Commit 57b6cec

Browse files
committed
---
yaml --- r: 34875 b: refs/heads/master c: e0a9d41 h: refs/heads/master i: 34873: ae54392 34871: ef800c6 v: v3
1 parent 751715c commit 57b6cec

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 254a86e49edb0fbf38d335a50b1ab535fa7fd757
2+
refs/heads/master: e0a9d41b04f16b7771315dcbfcb4e1fa4c347c33
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/src/libstd/sort.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,25 @@ mod test_tim_sort {
10461046
tim_sort(arr);
10471047
fail ~"Guarantee the fail";
10481048
}
1049+
1050+
struct DVal { val: ~uint }
1051+
impl DVal: Ord {
1052+
pure fn lt(_x: &DVal) -> bool { true }
1053+
pure fn le(_x: &DVal) -> bool { true }
1054+
pure fn gt(_x: &DVal) -> bool { true }
1055+
pure fn ge(_x: &DVal) -> bool { true }
1056+
}
1057+
1058+
#[test]
1059+
fn test_bad_Ord_impl() {
1060+
let rng = rand::Rng();
1061+
let mut arr = do vec::from_fn(500) |_i| {
1062+
let randVal = rng.gen_uint();
1063+
DVal { val: ~randVal }
1064+
};
1065+
1066+
tim_sort(arr);
1067+
}
10491068
}
10501069

10511070
#[cfg(test)]

0 commit comments

Comments
 (0)