Replace remaining instances of use of debug feature with debug_assertions.
Also fix some code that did not build in debug mode anymore (d'oh!) in `src/ion/merges.rs`, as exposed by this change.
This commit is contained in:
@@ -48,16 +48,16 @@ impl<'a, F: Function> Env<'a, F> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(debug)]
|
#[cfg(debug_assertions)]
|
||||||
{
|
{
|
||||||
// Sanity check: both bundles should contain only ranges with appropriate VReg classes.
|
// Sanity check: both bundles should contain only ranges with appropriate VReg classes.
|
||||||
for entry in &self.bundles[from.index()].ranges {
|
for entry in &self.bundles[from.index()].ranges {
|
||||||
let vreg = self.ranges[entry.index.index()].vreg;
|
let vreg = self.ranges[entry.index.index()].vreg;
|
||||||
assert_eq!(rc, self.vregs[vreg.index()].reg.class());
|
assert_eq!(from_rc, self.vreg_regs[vreg.index()].class());
|
||||||
}
|
}
|
||||||
for entry in &self.bundles[to.index()].ranges {
|
for entry in &self.bundles[to.index()].ranges {
|
||||||
let vreg = self.ranges[entry.index.index()].vreg;
|
let vreg = self.ranges[entry.index.index()].vreg;
|
||||||
assert_eq!(rc, self.vregs[vreg.index()].reg.class());
|
assert_eq!(to_rc, self.vreg_regs[vreg.index()].class());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ impl<T: Clone + Copy + Default> ParallelMoves<T> {
|
|||||||
// Sort moves by destination and check that each destination
|
// Sort moves by destination and check that each destination
|
||||||
// has only one writer.
|
// has only one writer.
|
||||||
self.parallel_moves.sort_by_key(|&(_, dst, _)| dst);
|
self.parallel_moves.sort_by_key(|&(_, dst, _)| dst);
|
||||||
if cfg!(debug) {
|
if cfg!(debug_assertions) {
|
||||||
let mut last_dst = None;
|
let mut last_dst = None;
|
||||||
for &(_, dst, _) in &self.parallel_moves {
|
for &(_, dst, _) in &self.parallel_moves {
|
||||||
if last_dst.is_some() {
|
if last_dst.is_some() {
|
||||||
assert!(last_dst.unwrap() != dst);
|
debug_assert!(last_dst.unwrap() != dst);
|
||||||
}
|
}
|
||||||
last_dst = Some(dst);
|
last_dst = Some(dst);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user