tests: work around #21721 some more by replacing some unit types with [u8; 0].
This commit is contained in:
parent
36fcfb02e2
commit
d13d74d6d8
2 changed files with 11 additions and 5 deletions
|
@ -134,7 +134,11 @@ pub trait Reseeder<R> {
|
||||||
/// Reseed an RNG using a `Default` instance. This reseeds by
|
/// Reseed an RNG using a `Default` instance. This reseeds by
|
||||||
/// replacing the RNG with the result of a `Default::default` call.
|
/// replacing the RNG with the result of a `Default::default` call.
|
||||||
#[derive(Copy)]
|
#[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<R: Rng + Default> Reseeder<R> for ReseedWithDefault {
|
impl<R: Rng + Default> Reseeder<R> for ReseedWithDefault {
|
||||||
fn reseed(&mut self, rng: &mut R) {
|
fn reseed(&mut self, rng: &mut R) {
|
||||||
|
|
|
@ -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
|
// Filled with things that have to be unwound
|
||||||
|
|
||||||
|
@ -81,11 +83,11 @@ fn recurse_or_panic(depth: int, st: Option<State>) {
|
||||||
}
|
}
|
||||||
Some(st) => {
|
Some(st) => {
|
||||||
let mut v = st.vec.clone();
|
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 {
|
State {
|
||||||
unique: box List::Cons((), box *st.unique),
|
unique: box List::Cons([], box *st.unique),
|
||||||
vec: v,
|
vec: v,
|
||||||
res: r(box List::Cons((), st.res._l.clone())),
|
res: r(box List::Cons([], st.res._l.clone())),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue