cfail: Remove usage of fmt!

This commit is contained in:
Alex Crichton 2013-09-29 20:06:21 -07:00
parent 630082ca89
commit ebf5f406ef
135 changed files with 182 additions and 201 deletions

View File

@ -11,9 +11,9 @@
fn test() {
let v: int;
v = 1; //~ NOTE prior assignment occurs here
info!("v=%d", v);
info2!("v={}", v);
v = 2; //~ ERROR re-assignment of immutable variable
info!("v=%d", v);
info2!("v={}", v);
}
fn main() {

View File

@ -27,5 +27,5 @@ fn cat(in_x : uint, in_y : int) -> cat {
fn main() {
let nyan : cat = cat(52u, 99);
nyan.speak = || info!("meow"); //~ ERROR attempted to take value of method
nyan.speak = || info2!("meow"); //~ ERROR attempted to take value of method
}

View File

@ -21,11 +21,11 @@ fn main() {
let a: clam = clam{x: @1, y: @2};
let b: clam = clam{x: @10, y: @20};
let z: int = a.x + b.y; //~ ERROR binary operation + cannot be applied to type `@int`
info!(z);
info2!("{:?}", z);
assert_eq!(z, 21);
let forty: fish = fish{a: @40};
let two: fish = fish{a: @2};
let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int`
info!(answer);
info2!("{:?}", answer);
assert_eq!(answer, 42);
}

View File

@ -12,7 +12,7 @@
// Tests that a function with a ! annotation always actually fails
fn bad_bang(i: uint) -> ! {
if i < 0u { } else { fail!(); }
if i < 0u { } else { fail2!(); }
//~^ ERROR expected `!` but found `()`
}

View File

@ -11,4 +11,4 @@
// error-pattern:expected `~str` but found `int`
static i: ~str = 10i;
fn main() { info!(i); }
fn main() { info2!("{:?}", i); }

View File

@ -12,7 +12,7 @@ struct X { x: () }
impl Drop for X {
fn drop(&mut self) {
error!("destructor runs");
error2!("destructor runs");
}
}
@ -20,6 +20,6 @@ fn main() {
let x = Some(X { x: () });
match x {
Some(ref _y @ _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
None => fail!()
None => fail2!()
}
}

View File

@ -12,7 +12,7 @@ struct X { x: (), }
impl Drop for X {
fn drop(&mut self) {
error!("destructor runs");
error2!("destructor runs");
}
}
@ -20,6 +20,6 @@ fn main() {
let x = Some((X { x: () }, X { x: () }));
match x {
Some((ref _y, _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
None => fail!()
None => fail2!()
}
}

View File

@ -12,7 +12,7 @@ struct X { x: (), }
impl Drop for X {
fn drop(&mut self) {
error!("destructor runs");
error2!("destructor runs");
}
}
@ -22,6 +22,6 @@ fn main() {
let x = some2(X { x: () }, X { x: () });
match x {
some2(ref _y, _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
none2 => fail!()
none2 => fail2!()
}
}

View File

@ -12,7 +12,7 @@ struct X { x: (), }
impl Drop for X {
fn drop(&mut self) {
error!("destructor runs");
error2!("destructor runs");
}
}
@ -20,6 +20,6 @@ fn main() {
let x = Some((X { x: () }, X { x: () }));
match x {
Some((_y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern
None => fail!()
None => fail2!()
}
}

View File

@ -15,8 +15,8 @@ fn main() {
let x = Some(p);
c.send(false);
match x {
Some(z) if z.recv() => { fail!() }, //~ ERROR cannot bind by-move into a pattern guard
Some(z) if z.recv() => { fail2!() }, //~ ERROR cannot bind by-move into a pattern guard
Some(z) => { assert!(!z.recv()); },
None => fail!()
None => fail2!()
}
}

View File

@ -12,7 +12,7 @@ struct X { x: (), }
impl Drop for X {
fn drop(&mut self) {
error!("destructor runs");
error2!("destructor runs");
}
}
@ -20,6 +20,6 @@ fn main() {
let x = Some(X { x: () });
match x {
Some(_y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings
None => fail!()
None => fail2!()
}
}

View File

@ -17,6 +17,6 @@ fn compute1() -> float {
fn main() {
let x = compute1();
info!(x);
info2!("{:?}", x);
assert_eq!(x, -4f);
}

View File

@ -21,6 +21,6 @@ fn coerce(b: &fn()) -> extern fn() {
fn main() {
let i = 8;
let f = coerce(|| error!(i) );
let f = coerce(|| error2!("{:?}", i) );
f();
}

View File

@ -17,7 +17,7 @@ enum color { rgb(int, int, int), rgba(int, int, int, int), }
fn main() {
let red: color = rgb(255, 0, 0);
match red {
rgb(r, g, b) => { info!("rgb"); }
hsl(h, s, l) => { info!("hsl"); }
rgb(r, g, b) => { info2!("rgb"); }
hsl(h, s, l) => { info2!("hsl"); }
}
}

View File

@ -10,12 +10,12 @@ fn distinct_variant() {
let a = match y {
Y(ref mut a, _) => a,
X => fail!()
X => fail2!()
};
let b = match y {
Y(_, ref mut b) => b,
X => fail!()
X => fail2!()
};
*a += 1;
@ -27,12 +27,12 @@ fn same_variant() {
let a = match y {
Y(ref mut a, _) => a,
X => fail!()
X => fail2!()
};
let b = match y {
Y(ref mut b, _) => b, //~ ERROR cannot borrow
X => fail!()
X => fail2!()
};
*a += 1;

View File

@ -21,7 +21,7 @@ fn a() {
p[0] = 5; //~ ERROR cannot assign
info!("%d", *q);
info2!("{}", *q);
}
fn borrow(_x: &[int], _f: &fn()) {}

View File

@ -24,7 +24,7 @@ fn main() {
x = X(Left((0,0))); //~ ERROR cannot assign to `x`
(*f)()
},
_ => fail!()
_ => fail2!()
}
}
}

View File

@ -18,7 +18,7 @@ struct Bar {
int2: int,
}
fn make_foo() -> ~Foo { fail!() }
fn make_foo() -> ~Foo { fail2!() }
fn borrow_same_field_twice_mut_mut() {
let mut foo = make_foo();

View File

@ -18,7 +18,7 @@ struct Bar {
int2: int,
}
fn make_foo() -> Foo { fail!() }
fn make_foo() -> Foo { fail2!() }
fn borrow_same_field_twice_mut_mut() {
let mut foo = make_foo();

View File

@ -16,7 +16,7 @@ struct defer<'self> {
impl<'self> Drop for defer<'self> {
fn drop(&mut self) {
unsafe {
error!("%?", self.x);
error2!("{:?}", self.x);
}
}
}

View File

@ -16,9 +16,9 @@
fn borrow(_v: &int) {}
fn borrow_mut(_v: &mut int) {}
fn cond() -> bool { fail!() }
fn for_func(_f: &fn() -> bool) { fail!() }
fn produce<T>() -> T { fail!(); }
fn cond() -> bool { fail2!() }
fn for_func(_f: &fn() -> bool) { fail2!() }
fn produce<T>() -> T { fail2!(); }
fn inc(v: &mut ~int) {
*v = ~(**v + 1);

View File

@ -16,8 +16,8 @@
fn borrow(_v: &int) {}
fn borrow_mut(_v: &mut int) {}
fn cond() -> bool { fail!() }
fn produce<T>() -> T { fail!(); }
fn cond() -> bool { fail2!() }
fn produce<T>() -> T { fail2!(); }
fn inc(v: &mut ~int) {
*v = ~(**v + 1);

View File

@ -13,7 +13,7 @@
#[allow(unused_variable)];
#[allow(dead_assignment)];
fn cond() -> bool { fail!() }
fn cond() -> bool { fail2!() }
fn link<'a>(v: &'a uint, w: &mut &'a uint) -> bool { *w = v; true }
fn separate_arms() {

View File

@ -16,9 +16,9 @@
fn borrow(_v: &int) {}
fn borrow_mut(_v: &mut int) {}
fn cond() -> bool { fail!() }
fn for_func(_f: &fn() -> bool) { fail!() }
fn produce<T>() -> T { fail!(); }
fn cond() -> bool { fail2!() }
fn for_func(_f: &fn() -> bool) { fail2!() }
fn produce<T>() -> T { fail2!(); }
fn inc(v: &mut ~int) {
*v = ~(**v + 1);

View File

@ -18,14 +18,14 @@ fn box_imm() {
let v = ~3;
let _w = &v;
do task::spawn {
info!("v=%d", *v);
info2!("v={}", *v);
//~^ ERROR cannot move `v` into closure
}
let v = ~3;
let _w = &v;
task::spawn(|| {
info!("v=%d", *v);
info2!("v={}", *v);
//~^ ERROR cannot move
});
}

View File

@ -16,7 +16,7 @@ use std::either::{Either, Left, Right};
*x = Right(1.0);
*z
}
_ => fail!()
_ => fail2!()
}
}

View File

@ -23,7 +23,7 @@ pub fn main() {
}
}
let z = tail[0].clone();
info!(fmt!("%?", z));
info2!("{:?}", z);
}
_ => {
unreachable!();

View File

@ -12,5 +12,5 @@ fn main() {
let x: int = 3;
let y: &mut int = &mut x; //~ ERROR cannot borrow
*y = 5;
info!(*y);
info2!("{:?}", *y);
}

View File

@ -14,7 +14,7 @@ fn main() {
Some(ref m) => { //~ ERROR borrowed value does not live long enough
msg = m;
},
None => { fail!() }
None => { fail2!() }
}
println(*msg);
}

View File

@ -2,7 +2,7 @@ fn a() -> &[int] {
let vec = ~[1, 2, 3, 4];
let tail = match vec {
[_, ..tail] => tail, //~ ERROR does not live long enough
_ => fail!("a")
_ => fail2!("a")
};
tail
}
@ -11,7 +11,7 @@ fn b() -> &[int] {
let vec = ~[1, 2, 3, 4];
let init = match vec {
[..init, _] => init, //~ ERROR does not live long enough
_ => fail!("b")
_ => fail2!("b")
};
init
}
@ -20,7 +20,7 @@ fn c() -> &[int] {
let vec = ~[1, 2, 3, 4];
let slice = match vec {
[_, ..slice, _] => slice, //~ ERROR does not live long enough
_ => fail!("c")
_ => fail2!("c")
};
slice
}

View File

@ -4,7 +4,7 @@ fn a() {
[~ref _a] => {
vec[0] = ~4; //~ ERROR cannot assign to `(*vec)[]` because it is borrowed
}
_ => fail!("foo")
_ => fail2!("foo")
}
}

View File

@ -2,7 +2,7 @@ fn a() -> &int {
let vec = ~[1, 2, 3, 4];
let tail = match vec {
[_a, ..tail] => &tail[0], //~ ERROR borrowed value does not live long enough
_ => fail!("foo")
_ => fail2!("foo")
};
tail
}

View File

@ -22,12 +22,12 @@ struct cat {
impl cat {
pub fn eat(&self) -> bool {
if self.how_hungry > 0 {
error!("OM NOM NOM");
error2!("OM NOM NOM");
self.how_hungry -= 2;
return true;
}
else {
error!("Not hungry!");
error2!("Not hungry!");
return false;
}
}
@ -40,7 +40,7 @@ impl noisy for cat {
impl cat {
fn meow(&self) {
error!("Meow");
error2!("Meow");
self.meows += 1;
if self.meows % 5 == 0 {
self.how_hungry += 1;

View File

@ -15,7 +15,7 @@ struct cat {
impl cat {
fn sleep(&self) { loop{} }
fn meow(&self) {
error!("Meow");
error2!("Meow");
meows += 1u; //~ ERROR unresolved name
sleep(); //~ ERROR unresolved name
}

View File

@ -2,6 +2,6 @@ fn foo(f: &fn() -> !) {}
fn main() {
// Type inference didn't use to be able to handle this:
foo(|| fail!());
foo(|| fail2!());
foo(|| 22); //~ ERROR mismatched types
}

View File

@ -26,5 +26,5 @@ fn main() {
let x = foo(10);
let _y = x.clone();
//~^ ERROR does not implement any method in scope
error!(x);
error2!("{:?}", x);
}

View File

@ -1,13 +0,0 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() {
debug!("%s %s", 3); //~ ERROR: not enough arguments
}

View File

@ -10,6 +10,6 @@
fn main() {
match *1 { //~ ERROR: cannot be dereferenced
_ => { fail!(); }
_ => { fail2!(); }
}
}

View File

@ -1,8 +0,0 @@
use std::str;
fn main() {
let v = ~"test";
let sslice = v.slice(0, v.len());
//~^ ERROR borrowed value does not live long enough
fail!(sslice);
}

View File

@ -14,7 +14,7 @@ struct X {
impl Drop for X {
fn drop(&mut self) {
error!("value: %s", self.x);
error2!("value: {}", self.x);
}
}
@ -26,5 +26,5 @@ fn unwrap(x: X) -> ~str {
fn main() {
let x = X { x: ~"hello" };
let y = unwrap(x);
error!("contents: %s", y);
error2!("contents: {}", y);
}

View File

@ -14,7 +14,7 @@ struct X {
impl Drop for X {
fn drop(&mut self) {
error!("value: %s", self.x);
error2!("value: {}", self.x);
}
}
@ -22,7 +22,7 @@ fn main() {
let x = X { x: ~"hello" };
match x {
X { x: y } => error!("contents: %s", y)
X { x: y } => error2!("contents: {}", y)
//~^ ERROR cannot move out of type `X`, which defines the `Drop` trait
}
}

View File

@ -1,2 +1,2 @@
// error-pattern: unresolved name `this_does_nothing_what_the`.
fn main() { info!("doing"); this_does_nothing_what_the; info!("boing"); }
fn main() { info2!("doing"); this_does_nothing_what_the; info2!("boing"); }

View File

@ -15,7 +15,7 @@ mod foo {
}
mod bar {
fn x() { info!("x"); }
fn x() { info2!("x"); }
pub fn y() { }
}

View File

@ -10,4 +10,4 @@
// error-pattern:missing type
fn main() { fmt!("%+"); }
fn main() { oldfmt!("%+"); }

View File

@ -10,4 +10,4 @@
// error-pattern:fmt! takes at least 1 argument
fn main() { fmt!(); }
fn main() { oldfmt!(); }

View File

@ -14,5 +14,5 @@ fn main() {
// fmt!'s first argument must be a literal. Hopefully this
// restriction can be eased eventually to just require a
// compile-time constant.
let x = fmt!("a" + "b");
let x = oldfmt!("a" + "b");
}

View File

@ -14,5 +14,5 @@ fn main() {
// fmt!'s first argument must be a literal. Hopefully this
// restriction can be eased eventually to just require a
// compile-time constant.
let x = fmt!(20);
let x = oldfmt!(20);
}

View File

@ -12,4 +12,4 @@
extern mod extra;
fn main() { let s = fmt!("%s%s%s", "test", "test"); }
fn main() { let s = oldfmt!("%s%s%s", "test", "test"); }

View File

@ -12,4 +12,4 @@
extern mod extra;
fn main() { let s = fmt!("%s", "test", "test"); }
fn main() { let s = oldfmt!("%s", "test", "test"); }

View File

@ -10,4 +10,4 @@
// error-pattern:unknown type
fn main() { fmt!("%w"); }
fn main() { oldfmt!("%w"); }

View File

@ -12,5 +12,5 @@
fn main() {
// Can't use a sign on unsigned conversions
fmt!("%+u", 10u);
oldfmt!("%+u", 10u);
}

View File

@ -12,5 +12,5 @@
fn main() {
// Can't use a space on unsigned conversions
fmt!("% u", 10u);
oldfmt!("% u", 10u);
}

View File

@ -10,4 +10,4 @@
// error-pattern:unterminated conversion
fn main() { fmt!("%"); }
fn main() { oldfmt!("%"); }

View File

@ -10,4 +10,4 @@
// error-pattern:failed to find an implementation of trait std::sys::FailWithCause for int
fn main() { fail!(5); }
fn main() { fail2!(5); }

View File

@ -12,5 +12,5 @@
// error-pattern:unexpected token
fn main() {
fail!(@);
fail2!(@);
}

View File

@ -9,4 +9,4 @@
// except according to those terms.
// error-pattern:failed to find an implementation of trait std::sys::FailWithCause for ~[int]
fn main() { fail!(~[0i]); }
fn main() { fail2!(~[0i]); }

View File

@ -17,7 +17,7 @@ use extra::arc::*;
struct A { y: Arc<int>, x: Arc<int> }
impl Drop for A {
fn drop(&mut self) { println(fmt!("x=%?", self.x.get())); }
fn drop(&mut self) { println(format!("x={:?}", self.x.get())); }
}
fn main() {
let a = A { y: Arc::new(1), x: Arc::new(2) };

View File

@ -12,5 +12,5 @@
fn main() {
let a = if true { true };
info!(a);
info2!("{:?}", a);
}

View File

@ -13,10 +13,10 @@
use module_of_many_things::*;
mod module_of_many_things {
pub fn f1() { info!("f1"); }
pub fn f2() { info!("f2"); }
fn f3() { info!("f3"); }
pub fn f4() { info!("f4"); }
pub fn f1() { info2!("f1"); }
pub fn f2() { info2!("f2"); }
fn f3() { info2!("f3"); }
pub fn f4() { info2!("f4"); }
}

View File

@ -12,13 +12,13 @@
mod circ1 {
pub use circ2::f2;
pub fn f1() { info!("f1"); }
pub fn f1() { info2!("f1"); }
pub fn common() -> uint { return 0u; }
}
mod circ2 {
pub use circ1::f1;
pub fn f2() { info!("f2"); }
pub fn f2() { info2!("f2"); }
pub fn common() -> uint { return 1u; }
}

View File

@ -12,6 +12,6 @@
use zed::bar;
use zed::baz;
mod zed {
pub fn bar() { info!("bar"); }
pub fn bar() { info2!("bar"); }
}
fn main(args: ~[str]) { bar(); }

View File

@ -13,6 +13,6 @@ use baz::zed::bar; //~ ERROR unresolved import
mod baz {}
mod zed {
pub fn bar() { info!("bar3"); }
pub fn bar() { info2!("bar3"); }
}
fn main(args: ~[str]) { bar(); }

View File

@ -11,4 +11,4 @@
// error-pattern: unresolved
use main::bar;
fn main(args: ~[str]) { info!("foo"); }
fn main(args: ~[str]) { info2!("foo"); }

View File

@ -13,4 +13,4 @@
mod a { pub use b::foo; }
mod b { pub use a::foo; }
fn main(args: ~[str]) { info!("loop"); }
fn main(args: ~[str]) { info2!("loop"); }

View File

@ -10,6 +10,8 @@
// Regression test for issue #1448 and #1386
fn foo(a: uint) -> uint { a }
fn main() {
info!("%u", 10i); //~ ERROR mismatched types
info2!("{:u}", foo(10i)); //~ ERROR mismatched types
}

View File

@ -9,5 +9,5 @@
// except according to those terms.
fn main() {
error!(x); //~ ERROR unresolved name `x`.
error2!("{:?}", x); //~ ERROR unresolved name `x`.
}

View File

@ -14,7 +14,7 @@ trait vec_monad<A> {
impl<A> vec_monad<A> for ~[A] {
fn bind<B>(&self, f: &fn(A) -> ~[B]) {
let mut r = fail!();
let mut r = fail2!();
for elt in self.iter() { r = r + f(*elt); }
//~^ WARNING unreachable expression
//~^^ ERROR the type of this value must be known

View File

@ -13,7 +13,7 @@
fn fail_len(v: ~[int]) -> uint {
let mut i = 3;
fail!();
fail2!();
for x in v.iter() { i += 1u; }
//~^ ERROR: unreachable statement
return i;

View File

@ -9,6 +9,6 @@
// except according to those terms.
fn main() {
let x = fail!();
let x = fail2!();
x.clone(); //~ ERROR the type of this value must be known in this context
}

View File

@ -10,4 +10,4 @@
// error-pattern: unresolved name `foobar`.
fn main(args: ~[str]) { info!(foobar); }
fn main(args: ~[str]) { info2!("{:?}", foobar); }

View File

@ -16,7 +16,7 @@ trait channel<T> {
// `chan` is not a trait, it's an enum
impl chan for int { //~ ERROR chan is not a trait
fn send(&self, v: int) { fail!() }
fn send(&self, v: int) { fail2!() }
}
fn main() {

View File

@ -15,5 +15,5 @@ struct cat {
fn main() {
let kitty : cat = cat { x: () };
error!(*kitty);
error2!("{:?}", *kitty);
}

View File

@ -15,5 +15,5 @@ struct cat {
fn main() {
let nyan = cat { foo: () };
error!(*nyan);
error2!("{:?}", *nyan);
}

View File

@ -20,7 +20,7 @@ struct E {
}
impl A for E {
fn b<F:Freeze,G>(_x: F) -> F { fail!() } //~ ERROR type parameter 0 requires `Freeze`
fn b<F:Freeze,G>(_x: F) -> F { fail2!() } //~ ERROR type parameter 0 requires `Freeze`
}
fn main() {}

View File

@ -21,7 +21,7 @@ struct E {
impl A for E {
// n.b. The error message is awful -- see #3404
fn b<F:Clone,G>(&self, _x: G) -> G { fail!() } //~ ERROR method `b` has an incompatible type
fn b<F:Clone,G>(&self, _x: G) -> G { fail2!() } //~ ERROR method `b` has an incompatible type
}
fn main() {}

View File

@ -14,7 +14,7 @@ struct C {
impl Drop for C {
fn drop(&mut self) {
error!("dropping: %?", self.x);
error2!("dropping: {:?}", self.x);
}
}

View File

@ -25,7 +25,7 @@ fn siphash(k0 : u64) -> SipHash {
//~^ ERROR unresolved name `k0`.
}
}
fail!();
fail2!();
}
fn main() {}

View File

@ -19,13 +19,13 @@ fn main()
{
let _z = match g(1, 2) {
g(x, x) => { info!(x + x); }
g(x, x) => { info2!("{:?}", x + x); }
//~^ ERROR Identifier `x` is bound more than once in the same pattern
};
let _z = match i(l(1, 2), m(3, 4)) {
i(l(x, _), m(_, x)) //~ ERROR Identifier `x` is bound more than once in the same pattern
=> { error!(x + x); }
=> { error2!("{:?}", x + x); }
};
let _z = match (1, 2) {

View File

@ -9,13 +9,13 @@
// except according to those terms.
fn a(x: ~str) -> ~str {
fmt!("First function with %s", x)
format!("First function with {}", x)
}
fn a(x: ~str, y: ~str) -> ~str { //~ ERROR duplicate definition of value `a`
fmt!("Second function with %s and %s", x, y)
format!("Second function with {} and {}", x, y)
}
fn main() {
info!("Result: ");
info2!("Result: ");
}

View File

@ -13,5 +13,5 @@ fn main() {
static y: int = foo + 1; //~ ERROR: attempt to use a non-constant value in a constant
error!(y);
error2!("{}", y);
}

View File

@ -15,5 +15,5 @@ fn main() {
Bar = foo //~ ERROR attempt to use a non-constant value in a constant
}
error!(Bar);
error2!("{:?}", Bar);
}

View File

@ -37,6 +37,6 @@ fn main() {
~Element(ed) => match ed.kind { //~ ERROR non-exhaustive patterns
~HTMLImageElement(ref d) if d.image.is_some() => { true }
},
_ => fail!("WAT") //~ ERROR unreachable pattern
_ => fail2!("WAT") //~ ERROR unreachable pattern
};
}

View File

@ -16,7 +16,7 @@ trait PTrait {
impl PTrait for P {
fn getChildOption(&self) -> Option<@P> {
static childVal: @P = self.child.get(); //~ ERROR attempt to use a non-constant value in a constant
fail!();
fail2!();
}
}

View File

@ -8,4 +8,4 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn main() { fmt!("%?", None); } //~ ERROR unconstrained type
fn main() { format!("{:?}", None); } //~ ERROR unconstrained type

View File

@ -25,5 +25,5 @@ impl Bar {
fn main () {
let bar = Bar { bar: 1 };
let foo = bar.make_foo(2);
println(fmt!("%d", foo.foo));
println!("{}", foo.foo);
}

View File

@ -9,4 +9,4 @@
// except according to those terms.
fn foo<T>(t: T) {}
fn main() { foo(fail!()) } //~ ERROR cannot determine a type for this expression: unconstrained type
fn main() { foo(fail2!()) } //~ ERROR cannot determine a type for this expression: unconstrained type

View File

@ -9,5 +9,5 @@
// except according to those terms.
fn main() {
fmt!("%?", None); //~ ERROR: cannot determine a type for this expression: unconstrained type
format!("{:?}", None); //~ ERROR: cannot determine a type for this bounded
}

View File

@ -19,7 +19,7 @@ mod foo {
}
}
fn callback<T>(_f: &fn() -> T) -> T { fail!() }
fn callback<T>(_f: &fn() -> T) -> T { fail2!() }
unsafe fn unsf() {}
fn bad1() { unsafe {} } //~ ERROR: unnecessary `unsafe` block
@ -49,7 +49,7 @@ fn good2() {
sure that when purity is inherited that the source of the unsafe-ness
is tracked correctly */
unsafe {
unsafe fn what() -> ~[~str] { fail!() }
unsafe fn what() -> ~[~str] { fail2!() }
do callback {
what();

View File

@ -11,6 +11,6 @@
fn main() {
let i: int;
info!(false && { i = 5; true });
info!(i); //~ ERROR use of possibly uninitialized variable: `i`
info2!("{}", false && { i = 5; true });
info2!("{}", i); //~ ERROR use of possibly uninitialized variable: `i`
}

View File

@ -12,6 +12,6 @@
// Tests that a function with a ! annotation always actually fails
// error-pattern: some control paths may return
fn bad_bang(i: uint) -> ! { info!(3); }
fn bad_bang(i: uint) -> ! { info2!("{}", 3); }
fn main() { bad_bang(5u); }

View File

@ -12,6 +12,6 @@ fn force(f: &fn()) { f(); }
fn main() {
let x: int;
force(|| {
info!(x); //~ ERROR capture of possibly uninitialized variable: `x`
info2!("{}", x); //~ ERROR capture of possibly uninitialized variable: `x`
});
}

View File

@ -16,9 +16,9 @@ fn foo() -> int {
x = 0;
}
info!(x); //~ ERROR use of possibly uninitialized variable: `x`
info2!("{}", x); //~ ERROR use of possibly uninitialized variable: `x`
return 17;
}
fn main() { info!(foo()); }
fn main() { info2!("{}", foo()); }

View File

@ -16,9 +16,9 @@ fn foo() -> int {
x = 0;
}
info!(x); //~ ERROR use of possibly uninitialized variable: `x`
info2!("{}", x); //~ ERROR use of possibly uninitialized variable: `x`
return 17;
}
fn main() { info!(foo()); }
fn main() { info2!("{}", foo()); }

View File

@ -9,4 +9,4 @@
// except according to those terms.
fn force(f: &fn() -> int) -> int { f() }
fn main() { info!(force(|| {})); } //~ ERROR mismatched types
fn main() { info2!("{:?}", force(|| {})); } //~ ERROR mismatched types

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn foo(x: int) { info!(x); }
fn foo(x: int) { info2!("{}", x); }
fn main() {
let x: int; if 1 > 2 { x = 10; }

View File

@ -8,12 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
fn foo(x: int) { info!(x); }
fn foo(x: int) { info2!("{:?}", x); }
fn main() {
let x: int;
if 1 > 2 {
info!("whoops");
info2!("whoops");
} else {
x = 10;
}

View File

@ -13,5 +13,5 @@ fn main() {
let i: int;
i //~ ERROR use of possibly uninitialized variable: `i`
};
error!(f());
error2!("{:?}", f());
}

View File

@ -12,7 +12,7 @@ fn main() {
let y: ~int = ~42;
let mut x: ~int;
loop {
info!(y);
info2!("{:?}", y);
loop {
loop {
loop {

View File

@ -13,7 +13,7 @@ fn main() {
let y: ~int = ~42;
let mut x: ~int;
loop {
info!(y); //~ ERROR use of moved value: `y`
info2!("{:?}", y); //~ ERROR use of moved value: `y`
while true { while true { while true { x = y; x.clone(); } } }
//~^ ERROR use of moved value: `y`
}

View File

@ -11,6 +11,6 @@
fn main() {
let i: int;
info!(false || { i = 5; true });
info!(i); //~ ERROR use of possibly uninitialized variable: `i`
info2!("{}", false || { i = 5; true });
info2!("{}", i); //~ ERROR use of possibly uninitialized variable: `i`
}

Some files were not shown because too many files have changed in this diff Show More