From d13d74d6d8af151a319d71b1add12b6b22ef8812 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Sun, 15 Feb 2015 16:01:47 +0200 Subject: [PATCH] tests: work around #21721 some more by replacing some unit types with [u8; 0]. --- src/librand/reseeding.rs | 6 +++++- src/test/bench/task-perf-alloc-unwind.rs | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index 06828911471..f4d3e975b75 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -134,7 +134,11 @@ pub trait Reseeder { /// Reseed an RNG using a `Default` instance. This reseeds by /// replacing the RNG with the result of a `Default::default` call. #[derive(Copy)] -pub struct ReseedWithDefault; +pub struct ReseedWithDefault { __hack: [u8; 0] } +// FIXME(#21721) used to be an unit struct but that can cause +// certain LLVM versions to abort during optimizations. +#[allow(non_upper_case_globals)] +pub const ReseedWithDefault: ReseedWithDefault = ReseedWithDefault { __hack: [] }; impl Reseeder for ReseedWithDefault { fn reseed(&mut self, rng: &mut R) { diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index f09e64cb9c5..c45efe5f54b 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -40,7 +40,9 @@ fn run(repeat: int, depth: int) { } } -type nillist = List<()>; +// FIXME(#21721) used to be `List<()>` but that can cause +// certain LLVM versions to abort during optimizations. +type nillist = List<[u8; 0]>; // Filled with things that have to be unwound @@ -81,11 +83,11 @@ fn recurse_or_panic(depth: int, st: Option) { } Some(st) => { let mut v = st.vec.clone(); - v.push_all(&[box List::Cons((), st.vec.last().unwrap().clone())]); + v.push_all(&[box List::Cons([], st.vec.last().unwrap().clone())]); State { - unique: box List::Cons((), box *st.unique), + unique: box List::Cons([], box *st.unique), vec: v, - res: r(box List::Cons((), st.res._l.clone())), + res: r(box List::Cons([], st.res._l.clone())), } } };