Skip to content

Commit 470ca1c

Browse files
committedApr 7, 2016
Auto merge of #32794 - Manishearth:rollup, r=Manishearth
Rollup of 7 pull requests - Successful merges: #32674, #32699, #32711, #32745, #32748, #32757, #32789 - Failed merges:
2 parents 444a118 + b0f81a3 commit 470ca1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+815
-521
lines changed
 

‎src/liballoc/arc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ impl<T: ?Sized> Arc<T> {
263263
loop {
264264
// check if the weak counter is currently "locked"; if so, spin.
265265
if cur == usize::MAX {
266+
cur = this.inner().weak.load(Relaxed);
266267
continue;
267268
}
268269

‎src/libcollectionstest/slice.rs

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -574,18 +574,48 @@ fn test_slice_2() {
574574
assert_eq!(v[1], 3);
575575
}
576576

577+
macro_rules! assert_order {
578+
(Greater, $a:expr, $b:expr) => {
579+
assert_eq!($a.cmp($b), Greater);
580+
assert!($a > $b);
581+
};
582+
(Less, $a:expr, $b:expr) => {
583+
assert_eq!($a.cmp($b), Less);
584+
assert!($a < $b);
585+
};
586+
(Equal, $a:expr, $b:expr) => {
587+
assert_eq!($a.cmp($b), Equal);
588+
assert_eq!($a, $b);
589+
}
590+
}
591+
592+
#[test]
593+
fn test_total_ord_u8() {
594+
let c = &[1u8, 2, 3];
595+
assert_order!(Greater, &[1u8, 2, 3, 4][..], &c[..]);
596+
let c = &[1u8, 2, 3, 4];
597+
assert_order!(Less, &[1u8, 2, 3][..], &c[..]);
598+
let c = &[1u8, 2, 3, 6];
599+
assert_order!(Equal, &[1u8, 2, 3, 6][..], &c[..]);
600+
let c = &[1u8, 2, 3, 4, 5, 6];
601+
assert_order!(Less, &[1u8, 2, 3, 4, 5, 5, 5, 5][..], &c[..]);
602+
let c = &[1u8, 2, 3, 4];
603+
assert_order!(Greater, &[2u8, 2][..], &c[..]);
604+
}
605+
606+
577607
#[test]
578-
fn test_total_ord() {
608+
fn test_total_ord_i32() {
579609
let c = &[1, 2, 3];
580-
[1, 2, 3, 4][..].cmp(c) == Greater;
610+
assert_order!(Greater, &[1, 2, 3, 4][..], &c[..]);
581611
let c = &[1, 2, 3, 4];
582-
[1, 2, 3][..].cmp(c) == Less;
612+
assert_order!(Less, &[1, 2, 3][..], &c[..]);
583613
let c = &[1, 2, 3, 6];
584-
[1, 2, 3, 4][..].cmp(c) == Equal;
614+
assert_order!(Equal, &[1, 2, 3, 6][..], &c[..]);
585615
let c = &[1, 2, 3, 4, 5, 6];
586-
[1, 2, 3, 4, 5, 5, 5, 5][..].cmp(c) == Less;
616+
assert_order!(Less, &[1, 2, 3, 4, 5, 5, 5, 5][..], &c[..]);
587617
let c = &[1, 2, 3, 4];
588-
[2, 2][..].cmp(c) == Greater;
618+
assert_order!(Greater, &[2, 2][..], &c[..]);
589619
}
590620

591621
#[test]

0 commit comments

Comments
 (0)
Please sign in to comment.