Drop the '2' suffix from logging macros
Who doesn't like a massive renaming?
This commit is contained in:
parent
15a6bdebab
commit
daf5f5a4d1
726 changed files with 3060 additions and 3060 deletions
|
@ -1063,7 +1063,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
|
|||
|
||||
#[inline]
|
||||
fn head(&self) -> &'self T {
|
||||
if self.len() == 0 { fail2!("head: empty vector") }
|
||||
if self.len() == 0 { fail!("head: empty vector") }
|
||||
&self[0]
|
||||
}
|
||||
|
||||
|
@ -1090,7 +1090,7 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
|
|||
|
||||
#[inline]
|
||||
fn last(&self) -> &'self T {
|
||||
if self.len() == 0 { fail2!("last: empty vector") }
|
||||
if self.len() == 0 { fail!("last: empty vector") }
|
||||
&self[self.len() - 1]
|
||||
}
|
||||
|
||||
|
@ -1409,7 +1409,7 @@ impl<T> OwnedVector<T> for ~[T] {
|
|||
let alloc = n * mem::nonzero_size_of::<T>();
|
||||
let size = alloc + mem::size_of::<Vec<()>>();
|
||||
if alloc / mem::nonzero_size_of::<T>() != n || size < alloc {
|
||||
fail2!("vector size is too large: {}", n);
|
||||
fail!("vector size is too large: {}", n);
|
||||
}
|
||||
*ptr = realloc_raw(*ptr as *mut c_void, size)
|
||||
as *mut Vec<()>;
|
||||
|
@ -1428,7 +1428,7 @@ impl<T> OwnedVector<T> for ~[T] {
|
|||
fn reserve_additional(&mut self, n: uint) {
|
||||
if self.capacity() - self.len() < n {
|
||||
match self.len().checked_add(&n) {
|
||||
None => fail2!("vec::reserve_additional: `uint` overflow"),
|
||||
None => fail!("vec::reserve_additional: `uint` overflow"),
|
||||
Some(new_cap) => self.reserve_at_least(new_cap)
|
||||
}
|
||||
}
|
||||
|
@ -1622,7 +1622,7 @@ impl<T> OwnedVector<T> for ~[T] {
|
|||
fn swap_remove(&mut self, index: uint) -> T {
|
||||
let ln = self.len();
|
||||
if index >= ln {
|
||||
fail2!("vec::swap_remove - index {} >= length {}", index, ln);
|
||||
fail!("vec::swap_remove - index {} >= length {}", index, ln);
|
||||
}
|
||||
if index < ln - 1 {
|
||||
self.swap(index, ln - 1);
|
||||
|
@ -2997,7 +2997,7 @@ mod tests {
|
|||
3 => assert_eq!(v, [2, 3, 1]),
|
||||
4 => assert_eq!(v, [2, 1, 3]),
|
||||
5 => assert_eq!(v, [1, 2, 3]),
|
||||
_ => fail2!(),
|
||||
_ => fail!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3244,7 +3244,7 @@ mod tests {
|
|||
#[should_fail]
|
||||
fn test_from_fn_fail() {
|
||||
do from_fn(100) |v| {
|
||||
if v == 50 { fail2!() }
|
||||
if v == 50 { fail!() }
|
||||
(~0, @0)
|
||||
};
|
||||
}
|
||||
|
@ -3263,7 +3263,7 @@ mod tests {
|
|||
fn clone(&self) -> S {
|
||||
let s = unsafe { cast::transmute_mut(self) };
|
||||
s.f += 1;
|
||||
if s.f == 10 { fail2!() }
|
||||
if s.f == 10 { fail!() }
|
||||
S { f: s.f, boxes: s.boxes.clone() }
|
||||
}
|
||||
}
|
||||
|
@ -3280,7 +3280,7 @@ mod tests {
|
|||
push((~0, @0));
|
||||
push((~0, @0));
|
||||
push((~0, @0));
|
||||
fail2!();
|
||||
fail!();
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -3290,7 +3290,7 @@ mod tests {
|
|||
let mut v = ~[];
|
||||
do v.grow_fn(100) |i| {
|
||||
if i == 50 {
|
||||
fail2!()
|
||||
fail!()
|
||||
}
|
||||
(~0, @0)
|
||||
}
|
||||
|
@ -3303,7 +3303,7 @@ mod tests {
|
|||
let mut i = 0;
|
||||
do v.map |_elt| {
|
||||
if i == 2 {
|
||||
fail2!()
|
||||
fail!()
|
||||
}
|
||||
i += 1;
|
||||
~[(~0, @0)]
|
||||
|
@ -3317,7 +3317,7 @@ mod tests {
|
|||
let mut i = 0;
|
||||
do flat_map(v) |_elt| {
|
||||
if i == 2 {
|
||||
fail2!()
|
||||
fail!()
|
||||
}
|
||||
i += 1;
|
||||
~[(~0, @0)]
|
||||
|
@ -3331,7 +3331,7 @@ mod tests {
|
|||
let mut i = 0;
|
||||
for _ in v.permutations_iter() {
|
||||
if i == 2 {
|
||||
fail2!()
|
||||
fail!()
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
|
@ -3342,7 +3342,7 @@ mod tests {
|
|||
fn test_as_imm_buf_fail() {
|
||||
let v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
||||
do v.as_imm_buf |_buf, _i| {
|
||||
fail2!()
|
||||
fail!()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3351,7 +3351,7 @@ mod tests {
|
|||
fn test_as_mut_buf_fail() {
|
||||
let mut v = [(~0, @0), (~0, @0), (~0, @0), (~0, @0)];
|
||||
do v.as_mut_buf |_buf, _i| {
|
||||
fail2!()
|
||||
fail!()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3816,7 +3816,7 @@ mod bench {
|
|||
sum += *x;
|
||||
}
|
||||
// sum == 11806, to stop dead code elimination.
|
||||
if sum == 0 {fail2!()}
|
||||
if sum == 0 {fail!()}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue