Skip to content

Commit 630082c

Browse files
committed
rpass: Remove usage of fmt!
1 parent 86e613c commit 630082c

File tree

308 files changed

+853
-843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+853
-843
lines changed

src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn parse_config(args: ~[~str]) -> config {
9191
let matches =
9292
&match getopts::groups::getopts(args_, groups) {
9393
Ok(m) => m,
94-
Err(f) => fail2!(f.to_err_msg())
94+
Err(f) => fail2!("{}", f.to_err_msg())
9595
};
9696

9797
if matches.opt_present("h") || matches.opt_present("help") {

src/test/auxiliary/cci_class_4.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@ pub mod kitties {
2121

2222
pub fn eat(&mut self) -> bool {
2323
if self.how_hungry > 0 {
24-
error!("OM NOM NOM");
24+
error2!("OM NOM NOM");
2525
self.how_hungry -= 2;
2626
return true;
2727
} else {
28-
error!("Not hungry!");
28+
error2!("Not hungry!");
2929
return false;
3030
}
3131
}
3232
}
3333

3434
impl cat {
3535
pub fn meow(&mut self) {
36-
error!("Meow");
36+
error2!("Meow");
3737
self.meows += 1u;
3838
if self.meows % 5u == 0u {
3939
self.how_hungry += 1;

src/test/auxiliary/cci_class_cast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub mod kitty {
2121

2222
impl cat {
2323
fn meow(&mut self) {
24-
error!("Meow");
24+
error2!("Meow");
2525
self.meows += 1u;
2626
if self.meows % 5u == 0u {
2727
self.how_hungry += 1;
@@ -35,12 +35,12 @@ pub mod kitty {
3535

3636
pub fn eat(&mut self) -> bool {
3737
if self.how_hungry > 0 {
38-
error!("OM NOM NOM");
38+
error2!("OM NOM NOM");
3939
self.how_hungry -= 2;
4040
return true;
4141
}
4242
else {
43-
error!("Not hungry!");
43+
error2!("Not hungry!");
4444
return false;
4545
}
4646
}

src/test/auxiliary/cci_nested_lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn alist_get<A:Clone + 'static,
3333
return entry.value.clone();
3434
}
3535
}
36-
fail!();
36+
fail2!();
3737
}
3838

3939
#[inline]

src/test/auxiliary/extern-crosscrate-source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub mod rustrt {
2828
#[fixed_stack_segment] #[inline(never)]
2929
pub fn fact(n: uint) -> uint {
3030
unsafe {
31-
info!("n = %?", n);
31+
info2!("n = {}", n);
3232
rustrt::rust_dbg_call(cb, n)
3333
}
3434
}

src/test/auxiliary/issue2378a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl <T:Clone> Index<uint,T> for maybe<T> {
1717
fn index(&self, _idx: &uint) -> T {
1818
match self {
1919
&just(ref t) => (*t).clone(),
20-
&nothing => { fail!(); }
20+
&nothing => { fail2!(); }
2121
}
2222
}
2323
}

src/test/auxiliary/issue_2723_a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
// except according to those terms.
1010

1111
pub unsafe fn f(xs: ~[int]) {
12-
xs.map(|_x| { unsafe fn q() { fail!(); } });
12+
xs.map(|_x| { unsafe fn q() { fail2!(); } });
1313
}

src/test/auxiliary/static-methods-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ impl read for bool {
3838
pub fn read<T:read>(s: ~str) -> T {
3939
match read::readMaybe(s) {
4040
Some(x) => x,
41-
_ => fail!("read failed!")
41+
_ => fail2!("read failed!")
4242
}
4343
}

src/test/run-pass/alignment-gep-tup-like-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn f<A:Clone + 'static>(a: A, b: u16) -> @Invokable<A> {
3636

3737
pub fn main() {
3838
let (a, b) = f(22_u64, 44u16).f();
39-
info!("a=%? b=%?", a, b);
39+
info2!("a={:?} b={:?}", a, b);
4040
assert_eq!(a, 22u64);
4141
assert_eq!(b, 44u16);
4242
}

src/test/run-pass/alignment-gep-tup-like-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub fn main() {
5555
let z = f(~x, y);
5656
make_cycle(z);
5757
let (a, b) = z.f();
58-
info!("a=%u b=%u", *a as uint, b as uint);
58+
info2!("a={} b={}", *a as uint, b as uint);
5959
assert_eq!(*a, x);
6060
assert_eq!(b, y);
6161
}

src/test/run-pass/arith-0.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
pub fn main() {
1414
let a: int = 10;
15-
info!(a);
15+
info2!("{}", a);
1616
assert_eq!(a * (a - 1), 90);
1717
}

src/test/run-pass/arith-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ pub fn main() {
2828
assert_eq!(i32_b << 1, i32_b << 1);
2929
assert_eq!(i32_b >> 1, i32_b >> 1);
3030
assert_eq!(i32_b & i32_b << 1, 0);
31-
info!(i32_b | i32_b << 1);
31+
info2!("{}", i32_b | i32_b << 1);
3232
assert_eq!(i32_b | i32_b << 1, 0x30303030);
3333
}

src/test/run-pass/attr-main-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// xfail-fast
1212

1313
pub fn main() {
14-
fail!()
14+
fail2!()
1515
}
1616

1717
#[main]

src/test/run-pass/auto-instantiate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ struct Triple { x: int, y: int, z: int }
1919
fn f<T,U>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
2020

2121
pub fn main() {
22-
info!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
23-
info!("%?", f(5, 6).a);
22+
info2!("{:?}", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
23+
info2!("{:?}", f(5, 6).a);
2424
}

src/test/run-pass/autoref-intermediate-types-issue-3585.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ trait Foo {
1414

1515
impl<T:Foo> Foo for @T {
1616
fn foo(&self) -> ~str {
17-
fmt!("@%s", (**self).foo())
17+
format!("@{}", (**self).foo())
1818
}
1919
}
2020

2121
impl Foo for uint {
2222
fn foo(&self) -> ~str {
23-
fmt!("%u", *self)
23+
format!("{}", *self)
2424
}
2525
}
2626

src/test/run-pass/binary-minus-without-space.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
// Check that issue #954 stays fixed
1212

1313
pub fn main() {
14-
match -1 { -1 => {}, _ => fail!("wat") }
14+
match -1 { -1 => {}, _ => fail2!("wat") }
1515
assert_eq!(1-1, 0);
1616
}

src/test/run-pass/bind-by-move.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ pub fn main() {
1818
let x = Some(p);
1919
match x {
2020
Some(z) => { dispose(z); },
21-
None => fail!()
21+
None => fail2!()
2222
}
2323
}

src/test/run-pass/binops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn test_class() {
8181
let mut r = p(1, 2);
8282

8383
unsafe {
84-
error!("q = %x, r = %x",
84+
error2!("q = {:x}, r = {:x}",
8585
(::std::cast::transmute::<*p, uint>(&q)),
8686
(::std::cast::transmute::<*p, uint>(&r)));
8787
}

src/test/run-pass/bitwise.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ fn general() {
2727
a ^= b;
2828
b ^= a;
2929
a = a ^ b;
30-
info!(a);
31-
info!(b);
30+
info2!("{}", a);
31+
info2!("{}", b);
3232
assert_eq!(b, 1);
3333
assert_eq!(a, 2);
3434
assert_eq!(!0xf0 & 0xff, 0xf);

src/test/run-pass/block-arg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub fn main() {
1414

1515
// Statement form does not require parentheses:
1616
for i in v.iter() {
17-
info!("%?", *i);
17+
info2!("{:?}", *i);
1818
}
1919

2020
// Usable at all:
@@ -35,14 +35,14 @@ pub fn main() {
3535
assert!(false);
3636
}
3737
match do v.iter().all |e| { e.is_negative() } {
38-
true => { fail!("incorrect answer."); }
38+
true => { fail2!("incorrect answer."); }
3939
false => { }
4040
}
4141
match 3 {
4242
_ if do v.iter().any |e| { e.is_negative() } => {
4343
}
4444
_ => {
45-
fail!("wrong answer.");
45+
fail2!("wrong answer.");
4646
}
4747
}
4848

src/test/run-pass/block-explicit-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
pub fn main() {
1212
fn as_buf<T>(s: ~str, f: &fn(~str) -> T) -> T { f(s) }
13-
as_buf(~"foo", |foo: ~str| -> () error!(foo) );
13+
as_buf(~"foo", |foo: ~str| -> () error2!("{}", foo) );
1414
}

src/test/run-pass/block-iter-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ pub fn main() {
2020
odds += 1;
2121
}
2222
});
23-
error!(odds);
23+
error2!("{:?}", odds);
2424
assert_eq!(odds, 4);
2525
}

src/test/run-pass/block-iter-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ pub fn main() {
2020
sum += *i * *j;
2121
});
2222
});
23-
error!(sum);
23+
error2!("{:?}", sum);
2424
assert_eq!(sum, 225);
2525
}

src/test/run-pass/borrowck-macro-interaction-issue-6304.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ impl Foo {
1919
);
2020
match s {
2121
~Bar2(id, rest) => declare!(id, self.elaborate_stm(rest)),
22-
_ => fail!()
22+
_ => fail2!()
2323
}
2424
}
2525

26-
fn check_id(&mut self, s: int) { fail!() }
26+
fn check_id(&mut self, s: int) { fail2!() }
2727
}
28-
28+
2929
pub fn main() { }

src/test/run-pass/borrowck-mut-uniq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ pub fn main() {
3131
add_int(ints, 44);
3232

3333
do iter_ints(ints) |i| {
34-
error!("int = %d", *i);
34+
error2!("int = {}", *i);
3535
true
3636
};
3737

38-
error!("ints=%?", ints);
38+
error2!("ints={:?}", ints);
3939
}

src/test/run-pass/borrowck-preserve-box-in-discr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn main() {
2323

2424
x = @F {f: ~4};
2525

26-
info!("ptr::to_unsafe_ptr(*b_x) = %x",
26+
info2!("ptr::to_unsafe_ptr(*b_x) = {:x}",
2727
ptr::to_unsafe_ptr(&(**b_x)) as uint);
2828
assert_eq!(**b_x, 3);
2929
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));

src/test/run-pass/borrowck-preserve-box-in-field.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn main() {
2828
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
2929
x = @F {f: ~4};
3030

31-
info!("ptr::to_unsafe_ptr(*b_x) = %x",
31+
info2!("ptr::to_unsafe_ptr(*b_x) = {:x}",
3232
ptr::to_unsafe_ptr(&(*b_x)) as uint);
3333
assert_eq!(*b_x, 3);
3434
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));

src/test/run-pass/borrowck-preserve-box-in-pat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn main() {
2323

2424
*x = @F {f: ~4};
2525

26-
info!("ptr::to_unsafe_ptr(*b_x) = %x",
26+
info2!("ptr::to_unsafe_ptr(*b_x) = {:x}",
2727
ptr::to_unsafe_ptr(&(**b_x)) as uint);
2828
assert_eq!(**b_x, 3);
2929
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));

src/test/run-pass/borrowck-preserve-box-in-uniq.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn main() {
2828
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
2929
*x = @F{f: ~4};
3030

31-
info!("ptr::to_unsafe_ptr(*b_x) = %x",
31+
info2!("ptr::to_unsafe_ptr(*b_x) = {:x}",
3232
ptr::to_unsafe_ptr(&(*b_x)) as uint);
3333
assert_eq!(*b_x, 3);
3434
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));

src/test/run-pass/borrowck-preserve-box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn main() {
2626
assert_eq!(ptr::to_unsafe_ptr(&(*x)), ptr::to_unsafe_ptr(&(*b_x)));
2727
x = @22;
2828

29-
info!("ptr::to_unsafe_ptr(*b_x) = %x",
29+
info2!("ptr::to_unsafe_ptr(*b_x) = {:x}",
3030
ptr::to_unsafe_ptr(&(*b_x)) as uint);
3131
assert_eq!(*b_x, 3);
3232
assert!(ptr::to_unsafe_ptr(&(*x)) != ptr::to_unsafe_ptr(&(*b_x)));

src/test/run-pass/borrowck-preserve-cond-box.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ fn testfn(cond: bool) {
2525
exp = 4;
2626
}
2727

28-
info!("*r = %d, exp = %d", *r, exp);
28+
info2!("*r = {}, exp = {}", *r, exp);
2929
assert_eq!(*r, exp);
3030

3131
x = @5;
3232
y = @6;
3333

34-
info!("*r = %d, exp = %d", *r, exp);
34+
info2!("*r = {}, exp = {}", *r, exp);
3535
assert_eq!(*r, exp);
3636
assert_eq!(x, @5);
3737
assert_eq!(y, @6);

src/test/run-pass/borrowck-preserve-expl-deref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub fn main() {
2828
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
2929
x = @F {f: ~4};
3030

31-
info!("ptr::to_unsafe_ptr(*b_x) = %x",
31+
info2!("ptr::to_unsafe_ptr(*b_x) = {:x}",
3232
ptr::to_unsafe_ptr(&(*b_x)) as uint);
3333
assert_eq!(*b_x, 3);
3434
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));

src/test/run-pass/borrowck-unary-move-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct noncopyable {
1414

1515
impl Drop for noncopyable {
1616
fn drop(&mut self) {
17-
error!("dropped");
17+
error2!("dropped");
1818
}
1919
}
2020

src/test/run-pass/box-inside-if.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn is_odd(_n: int) -> bool { return true; }
1919
fn length_is_even(_vs: @int) -> bool { return true; }
2020

2121
fn foo(_acc: int, n: int) {
22-
if is_odd(n) && length_is_even(some_box(1)) { error!("bloop"); }
22+
if is_odd(n) && length_is_even(some_box(1)) { error2!("bloop"); }
2323
}
2424

2525
pub fn main() { foo(67, 5); }

src/test/run-pass/box-inside-if2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn is_odd(_n: int) -> bool { return true; }
1919
fn length_is_even(_vs: @int) -> bool { return true; }
2020

2121
fn foo(_acc: int, n: int) {
22-
if is_odd(n) || length_is_even(some_box(1)) { error!("bloop"); }
22+
if is_odd(n) || length_is_even(some_box(1)) { error2!("bloop"); }
2323
}
2424

2525
pub fn main() { foo(67, 5); }

src/test/run-pass/box-unbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ fn unbox<T:Clone>(b: Box<T>) -> T { return (*b.c).clone(); }
1717
pub fn main() {
1818
let foo: int = 17;
1919
let bfoo: Box<int> = Box {c: @foo};
20-
info!("see what's in our box");
20+
info2!("see what's in our box");
2121
assert_eq!(unbox::<int>(bfoo), foo);
2222
}

src/test/run-pass/boxed-class-type-substitution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct Tree<T> {
1515
parent: Option<T>
1616
}
1717

18-
fn empty<T>() -> Tree<T> { fail!() }
18+
fn empty<T>() -> Tree<T> { fail2!() }
1919

2020
struct Box {
2121
tree: Tree<@Box>

0 commit comments

Comments
 (0)