From f96ee10e888bac4435973972f1799db509b3318e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 2 Oct 2014 15:12:58 -0700 Subject: [PATCH] Test fixes from the rollup --- src/liballoc/heap.rs | 1 + src/libgreen/basic.rs | 4 +- src/test/bench/task-perf-alloc-unwind.rs | 4 +- src/test/debuginfo/borrowed-struct.rs | 12 +++--- src/test/debuginfo/borrowed-tuple.rs | 4 +- src/test/debuginfo/boxed-struct.rs | 4 +- src/test/debuginfo/recursive-struct.rs | 32 +++++++-------- src/test/debuginfo/simd.rs | 40 +++++++++---------- .../var-captured-in-nested-closure.rs | 14 +++---- src/test/pretty/block-disambig.rs | 2 +- src/test/run-pass/issue-13167.rs | 2 +- 11 files changed, 60 insertions(+), 59 deletions(-) diff --git a/src/liballoc/heap.rs b/src/liballoc/heap.rs index 72384e25c3b..ef3ccd5aead 100644 --- a/src/liballoc/heap.rs +++ b/src/liballoc/heap.rs @@ -344,6 +344,7 @@ mod imp { mod test { extern crate test; use self::test::Bencher; + use heap; #[test] fn basic_reallocate_inplace_noop() { diff --git a/src/libgreen/basic.rs b/src/libgreen/basic.rs index 129d37638a3..4bb4eeb4950 100644 --- a/src/libgreen/basic.rs +++ b/src/libgreen/basic.rs @@ -73,13 +73,13 @@ impl BasicLoop { RunRemote(i) => { match self.remotes.iter_mut().find(|& &(id, _)| id == i) { Some(&(_, ref mut f)) => f.call(), - None => unreachable!() + None => fail!("bad remote: {}", i), } } RemoveRemote(i) => { match self.remotes.iter().position(|&(id, _)| id == i) { Some(i) => { self.remotes.remove(i).unwrap(); } - None => unreachable!() + None => fail!("bad remote: {}", i), } } } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index 6729373296b..a86b797544a 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -89,8 +89,8 @@ fn recurse_or_fail(depth: int, st: Option) { State { unique: box Cons((), box *st.unique), vec: st.vec.clone().append( - &[box Cons((), *st.vec.last().unwrap())]), - res: r(box Cons((), st.res._l)) + &[box Cons((), st.vec.last().unwrap().clone())]), + res: r(box Cons((), st.res._l.clone())) } } }; diff --git a/src/test/debuginfo/borrowed-struct.rs b/src/test/debuginfo/borrowed-struct.rs index 8b9c790bbbf..f0c63bfed02 100644 --- a/src/test/debuginfo/borrowed-struct.rs +++ b/src/test/debuginfo/borrowed-struct.rs @@ -30,13 +30,13 @@ // gdb-check:$4 = {x = 11, y = 24.5} // gdb-command:print *unique_val_ref -// gdb-check:$8 = {x = 13, y = 26.5} +// gdb-check:$5 = {x = 13, y = 26.5} // gdb-command:print *unique_val_interior_ref_1 -// gdb-check:$9 = 13 +// gdb-check:$6 = 13 // gdb-command:print *unique_val_interior_ref_2 -// gdb-check:$10 = 26.5 +// gdb-check:$7 = 26.5 // === LLDB TESTS ================================================================================== @@ -56,13 +56,13 @@ // lldb-check:[...]$3 = SomeStruct { x: 11, y: 24.5 } // lldb-command:print *unique_val_ref -// lldb-check:[...]$7 = SomeStruct { x: 13, y: 26.5 } +// lldb-check:[...]$4 = SomeStruct { x: 13, y: 26.5 } // lldb-command:print *unique_val_interior_ref_1 -// lldb-check:[...]$8 = 13 +// lldb-check:[...]$5 = 13 // lldb-command:print *unique_val_interior_ref_2 -// lldb-check:[...]$9 = 26.5 +// lldb-check:[...]$6 = 26.5 #![allow(unused_variable)] diff --git a/src/test/debuginfo/borrowed-tuple.rs b/src/test/debuginfo/borrowed-tuple.rs index 2c78d14a86c..e7b06af66fb 100644 --- a/src/test/debuginfo/borrowed-tuple.rs +++ b/src/test/debuginfo/borrowed-tuple.rs @@ -26,7 +26,7 @@ // gdb-check:$2 = {-15, -20} // gdb-command:print *unique_val_ref -// gdb-check:$4 = {-17, -22} +// gdb-check:$3 = {-17, -22} // === LLDB TESTS ================================================================================== @@ -40,7 +40,7 @@ // lldb-check:[...]$1 = (-15, -20) // lldb-command:print *unique_val_ref -// lldb-check:[...]$3 = (-17, -22) +// lldb-check:[...]$2 = (-17, -22) #![allow(unused_variable)] diff --git a/src/test/debuginfo/boxed-struct.rs b/src/test/debuginfo/boxed-struct.rs index a22b9fdea5c..120553442fc 100644 --- a/src/test/debuginfo/boxed-struct.rs +++ b/src/test/debuginfo/boxed-struct.rs @@ -22,7 +22,7 @@ // gdb-check:$1 = {x = 99, y = 999, z = 9999, w = 99999} // gdb-command:print *unique_dtor -// gdb-check:$3 = {x = 77, y = 777, z = 7777, w = 77777} +// gdb-check:$2 = {x = 77, y = 777, z = 7777, w = 77777} // === LLDB TESTS ================================================================================== @@ -33,7 +33,7 @@ // lldb-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 } // lldb-command:print *unique_dtor -// lldb-check:[...]$2 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 } +// lldb-check:[...]$1 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 } #![allow(unused_variable)] diff --git a/src/test/debuginfo/recursive-struct.rs b/src/test/debuginfo/recursive-struct.rs index 412bdfaaf15..40c056f5cd2 100644 --- a/src/test/debuginfo/recursive-struct.rs +++ b/src/test/debuginfo/recursive-struct.rs @@ -30,45 +30,45 @@ // gdb-check:$4 = 3 // gdb-command:print vec_unique[0].value -// gdb-check:$7 = 6.5 +// gdb-check:$5 = 6.5 // gdb-command:print vec_unique[0].next.RUST$ENCODED$ENUM$0$Empty.val->value -// gdb-check:$8 = 7.5 +// gdb-check:$6 = 7.5 // gdb-command:print borrowed_unique->value -// gdb-check:$9 = 8.5 +// gdb-check:$7 = 8.5 // gdb-command:print borrowed_unique->next.RUST$ENCODED$ENUM$0$Empty.val->value -// gdb-check:$10 = 9.5 +// gdb-check:$8 = 9.5 // LONG CYCLE // gdb-command:print long_cycle1.value -// gdb-check:$21 = 20 +// gdb-check:$9 = 20 // gdb-command:print long_cycle1.next->value -// gdb-check:$22 = 21 +// gdb-check:$10 = 21 // gdb-command:print long_cycle1.next->next->value -// gdb-check:$23 = 22 +// gdb-check:$11 = 22 // gdb-command:print long_cycle1.next->next->next->value -// gdb-check:$24 = 23 +// gdb-check:$12 = 23 // gdb-command:print long_cycle2.value -// gdb-check:$25 = 24 +// gdb-check:$13 = 24 // gdb-command:print long_cycle2.next->value -// gdb-check:$26 = 25 +// gdb-check:$14 = 25 // gdb-command:print long_cycle2.next->next->value -// gdb-check:$27 = 26 +// gdb-check:$15 = 26 // gdb-command:print long_cycle3.value -// gdb-check:$28 = 27 +// gdb-check:$16 = 27 // gdb-command:print long_cycle3.next->value -// gdb-check:$29 = 28 +// gdb-check:$17 = 28 // gdb-command:print long_cycle4.value -// gdb-check:$30 = 29.5 +// gdb-check:$18 = 29.5 // gdb-command:print (*****long_cycle_w_anonymous_types).value -// gdb-check:$31 = 30 +// gdb-check:$19 = 30 // gdb-command:print (*****((*****long_cycle_w_anonymous_types).next.RUST$ENCODED$ENUM$0$Empty.val)).value -// gdb-check:$32 = 31 +// gdb-check:$20 = 31 // gdb-command:continue diff --git a/src/test/debuginfo/simd.rs b/src/test/debuginfo/simd.rs index eee1d0e70ca..e355327a5ef 100644 --- a/src/test/debuginfo/simd.rs +++ b/src/test/debuginfo/simd.rs @@ -18,27 +18,27 @@ // gdb-command:run // gdb-command:finish -// gdb-command:print/d i8x16 +// gdb-command:print/d vi8x16 // gdb-check:$1 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} -// gdb-command:print/d i16x8 +// gdb-command:print/d vi16x8 // gdb-check:$2 = {16, 17, 18, 19, 20, 21, 22, 23} -// gdb-command:print/d i32x4 +// gdb-command:print/d vi32x4 // gdb-check:$3 = {24, 25, 26, 27} -// gdb-command:print/d i64x2 +// gdb-command:print/d vi64x2 // gdb-check:$4 = {28, 29} -// gdb-command:print/d u8x16 +// gdb-command:print/d vu8x16 // gdb-check:$5 = {30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45} -// gdb-command:print/d u16x8 +// gdb-command:print/d vu16x8 // gdb-check:$6 = {46, 47, 48, 49, 50, 51, 52, 53} -// gdb-command:print/d u32x4 +// gdb-command:print/d vu32x4 // gdb-check:$7 = {54, 55, 56, 57} -// gdb-command:print/d u64x2 +// gdb-command:print/d vu64x2 // gdb-check:$8 = {58, 59} -// gdb-command:print f32x4 +// gdb-command:print vf32x4 // gdb-check:$9 = {60.5, 61.5, 62.5, 63.5} -// gdb-command:print f64x2 +// gdb-command:print vf64x2 // gdb-check:$10 = {64.5, 65.5} // gdb-command:continue @@ -50,21 +50,21 @@ use std::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2}; fn main() { - let i8x16 = i8x16(0i8, 1i8, 2i8, 3i8, 4i8, 5i8, 6i8, 7i8, + let vi8x16 = i8x16(0i8, 1i8, 2i8, 3i8, 4i8, 5i8, 6i8, 7i8, 8i8, 9i8, 10i8, 11i8, 12i8, 13i8, 14i8, 15i8); - let i16x8 = i16x8(16i16, 17i16, 18i16, 19i16, 20i16, 21i16, 22i16, 23i16); - let i32x4 = i32x4(24i32, 25i32, 26i32, 27i32); - let i64x2 = i64x2(28i64, 29i64); + let vi16x8 = i16x8(16i16, 17i16, 18i16, 19i16, 20i16, 21i16, 22i16, 23i16); + let vi32x4 = i32x4(24i32, 25i32, 26i32, 27i32); + let vi64x2 = i64x2(28i64, 29i64); - let u8x16 = u8x16(30u8, 31u8, 32u8, 33u8, 34u8, 35u8, 36u8, 37u8, + let vu8x16 = u8x16(30u8, 31u8, 32u8, 33u8, 34u8, 35u8, 36u8, 37u8, 38u8, 39u8, 40u8, 41u8, 42u8, 43u8, 44u8, 45u8); - let u16x8 = u16x8(46u16, 47u16, 48u16, 49u16, 50u16, 51u16, 52u16, 53u16); - let u32x4 = u32x4(54u32, 55u32, 56u32, 57u32); - let u64x2 = u64x2(58u64, 59u64); + let vu16x8 = u16x8(46u16, 47u16, 48u16, 49u16, 50u16, 51u16, 52u16, 53u16); + let vu32x4 = u32x4(54u32, 55u32, 56u32, 57u32); + let vu64x2 = u64x2(58u64, 59u64); - let f32x4 = f32x4(60.5f32, 61.5f32, 62.5f32, 63.5f32); - let f64x2 = f64x2(64.5f64, 65.5f64); + let vf32x4 = f32x4(60.5f32, 61.5f32, 62.5f32, 63.5f32); + let vf64x2 = f64x2(64.5f64, 65.5f64); zzz(); } diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index 89415df3588..d72f9256883 100644 --- a/src/test/debuginfo/var-captured-in-nested-closure.rs +++ b/src/test/debuginfo/var-captured-in-nested-closure.rs @@ -29,22 +29,22 @@ // gdb-command:print *owned // gdb-check:$5 = 6 // gdb-command:print closure_local -// gdb-check:$7 = 8 +// gdb-check:$6 = 8 // gdb-command:continue // gdb-command:finish // gdb-command:print variable -// gdb-check:$8 = 1 +// gdb-check:$7 = 1 // gdb-command:print constant -// gdb-check:$9 = 2 +// gdb-check:$8 = 2 // gdb-command:print a_struct -// gdb-check:$10 = {a = -3, b = 4.5, c = 5} +// gdb-check:$9 = {a = -3, b = 4.5, c = 5} // gdb-command:print *struct_ref -// gdb-check:$11 = {a = -3, b = 4.5, c = 5} +// gdb-check:$10 = {a = -3, b = 4.5, c = 5} // gdb-command:print *owned -// gdb-check:$12 = 6 +// gdb-check:$11 = 6 // gdb-command:print closure_local -// gdb-check:$14 = 8 +// gdb-check:$12 = 8 // gdb-command:continue diff --git a/src/test/pretty/block-disambig.rs b/src/test/pretty/block-disambig.rs index 01fc70c1d2c..1b1765475f3 100644 --- a/src/test/pretty/block-disambig.rs +++ b/src/test/pretty/block-disambig.rs @@ -60,7 +60,7 @@ fn test9() { fn test10() -> int { let regs = vec!(0i); match true { true => { } _ => { } } - *(*regs).get(0) + regs[0] } fn test11() -> Vec { if true { } vec!(1, 2) } diff --git a/src/test/run-pass/issue-13167.rs b/src/test/run-pass/issue-13167.rs index 1a58a6842d4..be3ee0e0783 100644 --- a/src/test/run-pass/issue-13167.rs +++ b/src/test/run-pass/issue-13167.rs @@ -10,7 +10,7 @@ use std::slice; -pub struct PhfMapEntries<'a, T> { +pub struct PhfMapEntries<'a, T: 'a> { iter: slice::Items<'a, (&'static str, T)>, }