rfail: Remove usage of fmt!

This commit is contained in:
Alex Crichton 2013-09-29 21:08:46 -07:00
parent ebf5f406ef
commit 02054ac8a1
89 changed files with 114 additions and 114 deletions

View File

@ -9,6 +9,6 @@
// except according to those terms.
// error-pattern:meep
fn f(_a: int, _b: int, _c: @int) { fail!("moop"); }
fn f(_a: int, _b: int, _c: @int) { fail2!("moop"); }
fn main() { f(1, fail!("meep"), @42); }
fn main() { f(1, fail2!("meep"), @42); }

View File

@ -11,5 +11,5 @@
// error-pattern:failed at 'test-assert-fmt 42 rust'
fn main() {
assert!(false, "test-assert-fmt %d %s", 42, "rust");
assert!(false, "test-assert-fmt {} {}", 42, "rust");
}

View File

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn my_err(s: ~str) -> ! { error!(s); fail!("quux"); }
fn my_err(s: ~str) -> ! { error2!("{}", s); fail2!("quux"); }
fn main() { 3u == my_err(~"bye"); }

View File

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn foo() -> ! { fail!("quux"); }
fn foo() -> ! { fail2!("quux"); }
fn main() { foo() == foo(); }

View File

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn my_err(s: ~str) -> ! { error!(s); fail!("quux"); }
fn my_err(s: ~str) -> ! { error2!("{}", s); fail2!("quux"); }
fn main() { 3u == my_err(~"bye"); }

View File

@ -24,13 +24,13 @@ fn main() {
do x.as_imm_buf |p, _len| {
let base = p as uint;
let idx = base / sys::size_of::<uint>();
error!("ov1 base = 0x%x", base);
error!("ov1 idx = 0x%x", idx);
error!("ov1 sizeof::<uint>() = 0x%x", sys::size_of::<uint>());
error!("ov1 idx * sizeof::<uint>() = 0x%x",
error2!("ov1 base = 0x{:x}", base);
error2!("ov1 idx = 0x{:x}", idx);
error2!("ov1 sizeof::<uint>() = 0x{:x}", sys::size_of::<uint>());
error2!("ov1 idx * sizeof::<uint>() = 0x{:x}",
idx * sys::size_of::<uint>());
// This should fail.
error!("ov1 0x%x", x[idx]);
error2!("ov1 0x{:x}", x[idx]);
}
}

View File

@ -19,6 +19,6 @@ struct chan_t<T> {
port: port_id,
}
fn send<T:Send>(_ch: chan_t<T>, _data: T) { fail!(); }
fn send<T:Send>(_ch: chan_t<T>, _data: T) { fail2!(); }
fn main() { fail!("quux"); }
fn main() { fail2!("quux"); }

View File

@ -1,5 +1,5 @@
// error-pattern:test
fn main() {
let _i: int = fail!("test");
let _i: int = fail2!("test");
}

View File

@ -1,7 +1,7 @@
// error-pattern:test
fn f() {
fail!("test");
fail2!("test");
}
fn main() {

View File

@ -1,5 +1,5 @@
// error-pattern:test
fn main() {
fail!("test");
fail2!("test");
}

View File

@ -12,6 +12,6 @@
//error-pattern:One
fn main() {
fail!("One");
fail!("Two");
fail2!("One");
fail2!("Two");
}

View File

@ -15,5 +15,5 @@
fn main() {
let mut a = 1;
if 1 == 1 { a = 2; }
fail!(~"woooo" + "o");
fail2!(~"woooo" + "o");
}

View File

@ -12,4 +12,4 @@
// error-pattern:explicit
fn main() { fail!(); }
fn main() { fail2!(); }

View File

@ -12,6 +12,6 @@
// error-pattern:explicit failure
fn f() -> ! { fail!() }
fn f() -> ! { fail2!() }
fn main() { f(); }

View File

@ -12,7 +12,7 @@
// error-pattern:explicit failure
fn f() -> ! { fail!() }
fn f() -> ! { fail2!() }
fn g() -> int { let x = if true { f() } else { 10 }; return x; }

View File

@ -12,4 +12,4 @@
// error-pattern:explicit failure
fn main() { let _x = if false { 0 } else if true { fail!() } else { 10 }; }
fn main() { let _x = if false { 0 } else if true { fail2!() } else { 10 }; }

View File

@ -12,7 +12,7 @@
// error-pattern:explicit failure
fn f() -> ! { fail!() }
fn f() -> ! { fail2!() }
fn g() -> int { let x = match true { true => { f() } false => { 10 } }; return x; }

View File

@ -12,4 +12,4 @@
// error-pattern:explicit failure
fn main() { let _x = match true { false => { 0 } true => { fail!() } }; }
fn main() { let _x = match true { false => { 0 } true => { fail2!() } }; }

View File

@ -45,7 +45,7 @@ fn main() {
do task::spawn {
let result = count(5u);
info!("result = %?", result);
fail!();
fail2!();
};
}
}

View File

@ -9,6 +9,6 @@
// except according to those terms.
// error-pattern:woe
fn f(a: int) { info!(a); }
fn f(a: int) { info2!("{}", a); }
fn main() { f(fail!("woe")); }
fn main() { f(fail2!("woe")); }

View File

@ -11,5 +11,5 @@
// error-pattern:failed at 'explicit failure'
fn main() {
fail!();
fail2!();
}

View File

@ -11,5 +11,5 @@
// error-pattern:failed at 'test-fail-fmt 42 rust'
fn main() {
fail!("test-fail-fmt %d %s", 42, "rust");
fail2!("test-fail-fmt {} {}", 42, "rust");
}

View File

@ -11,5 +11,5 @@
// error-pattern:failed at 'test-fail-owned'
fn main() {
fail!("test-fail-owned");
fail2!("test-fail-owned");
}

View File

@ -11,5 +11,5 @@
// error-pattern:failed at 'test-fail-static'
fn main() {
fail!("test-fail-static");
fail2!("test-fail-static");
}

View File

@ -10,4 +10,4 @@
// error-pattern:moop
extern mod extra;
fn main() { fail!("moop"); }
fn main() { fail2!("moop"); }

View File

@ -13,8 +13,8 @@
// error-pattern:oops
fn bigfail() {
while (fail!("oops")) { if (fail!()) {
match (fail!()) { () => {
while (fail2!("oops")) { if (fail2!()) {
match (fail2!()) { () => {
}
}
}};

View File

@ -11,4 +11,4 @@
// error-pattern:meh
extern mod extra;
fn main() { let str_var: ~str = ~"meh"; fail!(fmt!("%s", str_var)); }
fn main() { let str_var: ~str = ~"meh"; fail2!("{}", str_var); }

View File

@ -11,4 +11,4 @@
// error-pattern:moop
extern mod extra;
fn main() { for _ in range(0u, 10u) { fail!("moop"); } }
fn main() { for _ in range(0u, 10u) { fail2!("moop"); } }

View File

@ -17,9 +17,9 @@ fn even(x: uint) -> bool {
fn foo(x: uint) {
if even(x) {
info!(x);
info2!("{}", x);
} else {
fail!("Number is odd");
fail2!("Number is odd");
}
}

View File

@ -9,5 +9,5 @@
// except according to those terms.
// error-pattern:quux
fn my_err(s: ~str) -> ! { error!(s); fail!("quux"); }
fn my_err(s: ~str) -> ! { error2!("{}", s); fail2!("quux"); }
fn main() { if my_err(~"bye") { } }

View File

@ -19,6 +19,6 @@ use std::io;
fn main() {
do io::with_str_reader(~"") |rdr| {
match rdr.read_char() { '=' => { } _ => { fail!() } }
match rdr.read_char() { '=' => { } _ => { fail2!() } }
}
}

View File

@ -22,5 +22,5 @@ fn main() {
},
a: ~0
};
fail!();
fail2!();
}

View File

@ -15,7 +15,7 @@ use extra::arc;
enum e<T> { e(arc::Arc<T>) }
fn foo() -> e<int> {fail!();}
fn foo() -> e<int> {fail2!();}
fn main() {
let _f = foo();

View File

@ -16,7 +16,7 @@
fn main() {
let mut x = ~[];
let y = ~[3];
fail!("so long");
fail2!("so long");
x.push_all_move(y);
~"good" + ~"bye";
}

View File

@ -16,5 +16,5 @@ struct Point { x: int, y: int }
fn main() {
let origin = Point {x: 0, y: 0};
let f: Point = Point {x: (fail!("beep boop")),.. origin};
let f: Point = Point {x: (fail2!("beep boop")),.. origin};
}

View File

@ -16,7 +16,7 @@
use std::comm;
use std::task;
fn child() { fail!(); }
fn child() { fail2!(); }
fn main() {
let (p, _c) = comm::stream::<()>();

View File

@ -16,7 +16,7 @@
use std::comm;
use std::task;
fn grandchild() { fail!("grandchild dies"); }
fn grandchild() { fail2!("grandchild dies"); }
fn child() {
let (p, _c) = comm::stream::<int>();

View File

@ -17,6 +17,6 @@ fn foo(s: ~str) { }
fn main() {
let i =
match Some::<int>(3) { None::<int> => { fail!() } Some::<int>(_) => { fail!() } };
match Some::<int>(3) { None::<int> => { fail2!() } Some::<int>(_) => { fail2!() } };
foo(i);
}

View File

@ -9,6 +9,6 @@
// except according to those terms.
// error-pattern:quux
fn f() -> ! { fail!("quux") }
fn f() -> ! { fail2!("quux") }
fn g() -> int { match f() { true => { 1 } false => { 0 } } }
fn main() { g(); }

View File

@ -11,10 +11,10 @@
// error-pattern:squirrelcupcake
fn cmp() -> int {
match (Some('a'), None::<char>) {
(Some(_), _) => { fail!("squirrelcupcake"); }
(_, Some(_)) => { fail!(); }
_ => { fail!("wat"); }
(Some(_), _) => { fail2!("squirrelcupcake"); }
(_, Some(_)) => { fail2!(); }
_ => { fail2!("wat"); }
}
}
fn main() { error!(cmp()); }
fn main() { error2!("{}", cmp()); }

View File

@ -14,7 +14,7 @@ fn getbig(i: int) {
if i != 0 {
getbig(i - 1);
} else {
fail!();
fail2!();
}
}

View File

@ -35,7 +35,7 @@ fn getbig_call_c_and_fail(i: int) {
} else {
unsafe {
rustrt::rust_get_argc();
fail!();
fail2!();
}
}
}

View File

@ -22,7 +22,7 @@ fn getbig_and_fail(i: int) {
if i != 0 {
getbig_and_fail(i - 1);
} else {
fail!();
fail2!();
}
}

View File

@ -22,7 +22,7 @@ fn getbig_and_fail(i: int) {
if i != 0 {
getbig_and_fail(i - 1);
} else {
fail!();
fail2!();
}
}

View File

@ -13,5 +13,5 @@
use std::result;
fn main() {
error!(result::Err::<int,~str>(~"kitty").unwrap());
error2!("{:?}", result::Err::<int,~str>(~"kitty").unwrap());
}

View File

@ -18,6 +18,6 @@
struct T { t: ~str }
fn main() {
let pth = fail!("bye");
let pth = fail2!("bye");
let _rs: T = T {t: pth};
}

View File

@ -13,10 +13,10 @@
use std::os;
fn main() {
error!(~"whatever");
error2!("whatever");
// Setting the exit status only works when the scheduler terminates
// normally. In this case we're going to fail, so instead of of
// returning 50 the process will return the typical rt failure code.
os::set_exit_status(50);
fail!();
fail2!();
}

View File

@ -33,9 +33,9 @@ fn r(x:int) -> r {
}
fn main() {
error!(~"whatever");
error2!("whatever");
do task::spawn {
let _i = r(5);
};
fail!();
fail2!();
}

View File

@ -13,7 +13,7 @@
use std::os;
fn main() {
error!(~"whatever");
error2!("whatever");
// 101 is the code the runtime uses on task failure and the value
// compiletest expects run-fail tests to return.
os::set_exit_status(101);

View File

@ -17,5 +17,5 @@ mod m {
pub fn exported() { }
#[test]
fn unexported() { fail!("runned an unexported test"); }
fn unexported() { fail2!("runned an unexported test"); }
}

View File

@ -15,5 +15,5 @@ use std::vec;
fn main() {
let v = vec::from_fn(1024u, {|n| n});
// this should trip a bounds check
error!(v[-1i8]);
error2!("{:?}", v[-1i8]);
}

View File

@ -17,7 +17,7 @@ use std::task;
// We don't want to see any invalid reads
fn main() {
fn f() {
fail!();
fail2!();
}
task::spawn(|| f() );
}

View File

@ -16,7 +16,7 @@ use std::task;
fn goodfail() {
task::deschedule();
fail!("goodfail");
fail2!("goodfail");
}
fn main() {
@ -25,5 +25,5 @@ fn main() {
// We shouldn't be able to get past this recv since there's no
// message available
let i: int = po.recv();
fail!("badfail");
fail2!("badfail");
}

View File

@ -15,5 +15,5 @@ use std::os;
fn main() {
os::args();
fail!("please have a nonzero exit status");
fail2!("please have a nonzero exit status");
}

View File

@ -9,4 +9,4 @@
// except according to those terms.
// error-pattern: fail
fn main() { ~fail!(); }
fn main() { ~fail2!(); }

View File

@ -11,14 +11,14 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {
let y = ~0;
let x: @~fn() = @(|| {
error!(y.clone());
error2!("{:?}", y.clone());
});
failfn();
error!(x);
error2!("{:?}", x);
}

View File

@ -13,7 +13,7 @@
use std::cast;
fn failfn() {
fail!();
fail2!();
}
struct r {
@ -41,6 +41,6 @@ fn main() {
cast::forget(i1);
let x = @r(i1p);
failfn();
error!(x);
error2!("{:?}", x);
}
}

View File

@ -11,11 +11,11 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {
let x = @~"hi";
failfn();
error!(x);
error2!("{:?}", x);
}

View File

@ -11,7 +11,7 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
trait i {
@ -25,5 +25,5 @@ impl i for ~int {
fn main() {
let x = @~0 as @i;
failfn();
error!(x);
error2!("{:?}", x);
}

View File

@ -11,11 +11,11 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {
let x = @~~0;
failfn();
error!(x);
error2!("{:?}", x);
}

View File

@ -11,11 +11,11 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {
let x = @~0;
failfn();
error!(x);
error2!("{:?}", x);
}

View File

@ -11,11 +11,11 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {
let x = @~[0, 1, 2, 3, 4, 5];
failfn();
error!(x);
error2!("{:?}", x);
}

View File

@ -11,7 +11,7 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {

View File

@ -12,5 +12,5 @@
fn main() {
@0;
fail!();
fail2!();
}

View File

@ -10,7 +10,7 @@
// error-pattern:fail
fn f() -> @int { fail!(); }
fn f() -> @int { fail2!(); }
fn main() {
let _a: @int = f();

View File

@ -12,6 +12,6 @@
fn main() {
let _a: @int = {
fail!();
fail2!();
};
}

View File

@ -12,7 +12,7 @@
fn a() { }
fn b() { fail!(); }
fn b() { fail2!(); }
fn main() {
let _x = ~[0];

View File

@ -14,7 +14,7 @@
#[allow(unused_variable)];
fn x(it: &fn(int)) {
fail!();
fail2!();
it(0);
}

View File

@ -16,5 +16,5 @@ fn x(it: &fn(int)) {
}
fn main() {
x(|_x| fail!() );
x(|_x| fail2!() );
}

View File

@ -22,7 +22,7 @@ fn main() {
let cheese = cheese.clone();
let f: &fn() = || {
let _chew = mush + cheese;
fail!("so yummy")
fail2!("so yummy")
};
f();
});

View File

@ -15,7 +15,7 @@ fn test_box() {
}
fn test_str() {
let res = match false { true => { ~"happy" },
_ => fail!("non-exhaustive match failure") };
_ => fail2!("non-exhaustive match failure") };
assert_eq!(res, ~"happy");
}
fn main() {

View File

@ -19,7 +19,7 @@ fn main() {
arr.push(@~"key stuff");
map.insert(arr.clone(), arr + &[@~"value stuff"]);
if arr.len() == 5 {
fail!();
fail2!();
}
}
}

View File

@ -10,7 +10,7 @@
// error-pattern:fail
fn f(_a: @int) {
fail!();
fail2!();
}
fn main() {

View File

@ -15,7 +15,7 @@ fn main() {
{
let _b = @0;
{
fail!();
fail2!();
}
}
}

View File

@ -10,7 +10,7 @@
// error-pattern:fail
fn f() -> ~[int] { fail!(); }
fn f() -> ~[int] { fail2!(); }
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
// have been to do with memory allocation patterns.

View File

@ -10,7 +10,7 @@
// error-pattern:fail
fn f() -> ~[int] { fail!(); }
fn f() -> ~[int] { fail2!(); }
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
// have been to do with memory allocation patterns.

View File

@ -10,7 +10,7 @@
// error-pattern:fail
fn f() -> ~[int] { fail!(); }
fn f() -> ~[int] { fail2!(); }
// Voodoo. In unwind-alt we had to do this to trigger the bug. Might
// have been to do with memory allocation patterns.

View File

@ -11,7 +11,7 @@
// error-pattern:fail
fn build() -> ~[int] {
fail!();
fail2!();
}
struct Blk { node: ~[int] }

View File

@ -15,7 +15,7 @@ fn build1() -> ~[int] {
}
fn build2() -> ~[int] {
fail!();
fail2!();
}
struct Blk { node: ~[int], span: ~[int] }

View File

@ -15,7 +15,7 @@ struct r {
}
impl Drop for r {
fn drop(&mut self) { fail!("squirrel") }
fn drop(&mut self) { fail2!("squirrel") }
}
fn r(i: int) -> r { r { i: i } }

View File

@ -16,7 +16,7 @@ struct r {
}
impl Drop for r {
fn drop(&mut self) { fail!("wombat") }
fn drop(&mut self) { fail2!("wombat") }
}
fn r(i: int) -> r { r { i: i } }
@ -24,5 +24,5 @@ fn r(i: int) -> r { r { i: i } }
fn main() {
@0;
let r = r(0);
fail!();
fail2!();
}

View File

@ -20,7 +20,7 @@ fn faily_box(i: @int) -> faily_box { faily_box { i: i } }
#[unsafe_destructor]
impl Drop for faily_box {
fn drop(&mut self) {
fail!("quux");
fail2!("quux");
}
}

View File

@ -12,7 +12,7 @@
fn f() {
let _a = @0;
fail!();
fail2!();
}
fn g() {

View File

@ -11,7 +11,7 @@
// error-pattern:fail
fn fold_local() -> @~[int]{
fail!();
fail2!();
}
fn main() {

View File

@ -15,7 +15,7 @@ fn fold_local() -> @~[int]{
}
fn fold_remote() -> @~[int]{
fail!();
fail2!();
}
fn main() {

View File

@ -11,7 +11,7 @@
// error-pattern:fail
fn f() {
fail!();
fail2!();
}
fn main() {

View File

@ -11,7 +11,7 @@
// error-pattern:fail
fn failfn() {
fail!();
fail2!();
}
fn main() {

View File

@ -11,4 +11,4 @@
#[allow(while_true)];
// error-pattern:quux
fn main() { let _x: int = { while true { fail!("quux"); } ; 8 } ; }
fn main() { let _x: int = { while true { fail2!("quux"); } ; 8 } ; }

View File

@ -12,5 +12,5 @@
// error-pattern:giraffe
fn main() {
fail!({ while true { fail!("giraffe") }; "clandestine" });
fail2!({ while true { fail2!("giraffe") }; "clandestine" });
}