cfail: Remove usage of fmt!
This commit is contained in:
parent
630082ca89
commit
ebf5f406ef
src/test/compile-fail
assign-imm-local-twice.rsassign-to-method.rsautoderef-full-lval.rsbad-bang-ann.rsbad-const-type.rsbind-by-move-neither-can-live-while-the-other-survives-1.rsbind-by-move-neither-can-live-while-the-other-survives-2.rsbind-by-move-neither-can-live-while-the-other-survives-3.rsbind-by-move-neither-can-live-while-the-other-survives-4.rsbind-by-move-no-guards.rsbind-by-move-no-sub-bindings.rsblock-arg-as-stmt-with-value.rsblock-coerce-no.rsbogus-tag.rsborrowck-anon-fields-variant.rsborrowck-assign-comp-idx.rsborrowck-autoref-3261.rsborrowck-borrow-from-owned-ptr.rsborrowck-borrow-from-stack-variable.rsborrowck-borrowed-uniq-rvalue-2.rsborrowck-lend-flow-if.rsborrowck-lend-flow-loop.rsborrowck-lend-flow-match.rsborrowck-lend-flow.rsborrowck-loan-blocks-move-cc.rsborrowck-loan-local-as-both-mut-and-imm.rsborrowck-move-out-of-vec-tail.rsborrowck-mut-addr-of-imm-var.rsborrowck-ref-into-rvalue.rsborrowck-vec-pattern-element-loan.rsborrowck-vec-pattern-nesting.rsborrowck-vec-pattern-tail-element-loan.rsclass-cast-to-trait.rsclass-missing-self.rsclosure-that-fails.rscopy-a-resource.rsdebug-correct-span.rsderef-non-pointer.rsdie-not-static.rsdisallowed-deconstructing-destructing-struct-let.rsdisallowed-deconstructing-destructing-struct-match.rsdoes-nothing.rsexport2.rsextfmt-missing-type.rsextfmt-no-args.rsextfmt-non-literal.rsextfmt-non-literal2.rsextfmt-not-enough-args.rsextfmt-too-many-args.rsextfmt-unknown-type.rsextfmt-unsigned-plus.rsextfmt-unsigned-space.rsextfmt-unterminated-conv.rsfail-expr.rsfail-simple.rsfail-type-err.rsfunctional-struct-update-noncopyable.rsif-without-else-result.rsimport-glob-0.rsimport-glob-circular.rsimport.rsimport2.rsimport3.rsimport4.rsissue-1448-2.rsissue-1476.rsissue-2149.rsissue-2150.rsissue-2151.rsissue-2281-part1.rsissue-2330.rsissue-2370-2.rsissue-2370.rsissue-2611-4.rsissue-2611-5.rsissue-2823.rsissue-3021.rsissue-3038.rsissue-3099.rsissue-3521-2.rsissue-3521.rsissue-3601.rsissue-3668.rsissue-5062.rsissue-5439.rsissue-6458-1.rsissue-6458-2.rslint-unused-unsafe.rsliveness-and-init.rsliveness-bad-bang-2.rsliveness-block-unint.rsliveness-break-uninit-2.rsliveness-break-uninit.rsliveness-closure-require-ret.rsliveness-if-no-else.rsliveness-if-with-else.rsliveness-init-in-fn-expr.rsliveness-move-in-loop.rsliveness-move-in-while.rsliveness-or-init.rs
@ -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() {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 `()`
|
||||
}
|
||||
|
||||
|
@ -11,4 +11,4 @@
|
||||
// error-pattern:expected `~str` but found `int`
|
||||
|
||||
static i: ~str = 10i;
|
||||
fn main() { info!(i); }
|
||||
fn main() { info2!("{:?}", i); }
|
||||
|
@ -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!()
|
||||
}
|
||||
}
|
||||
|
@ -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!()
|
||||
}
|
||||
}
|
||||
|
@ -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!()
|
||||
}
|
||||
}
|
||||
|
@ -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!()
|
||||
}
|
||||
}
|
||||
|
@ -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!()
|
||||
}
|
||||
}
|
||||
|
@ -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!()
|
||||
}
|
||||
}
|
||||
|
@ -17,6 +17,6 @@ fn compute1() -> float {
|
||||
|
||||
fn main() {
|
||||
let x = compute1();
|
||||
info!(x);
|
||||
info2!("{:?}", x);
|
||||
assert_eq!(x, -4f);
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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"); }
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -21,7 +21,7 @@ fn a() {
|
||||
|
||||
p[0] = 5; //~ ERROR cannot assign
|
||||
|
||||
info!("%d", *q);
|
||||
info2!("{}", *q);
|
||||
}
|
||||
|
||||
fn borrow(_x: &[int], _f: &fn()) {}
|
||||
|
@ -24,7 +24,7 @@ fn main() {
|
||||
x = X(Left((0,0))); //~ ERROR cannot assign to `x`
|
||||
(*f)()
|
||||
},
|
||||
_ => fail!()
|
||||
_ => fail2!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
@ -16,7 +16,7 @@ struct defer<'self> {
|
||||
impl<'self> Drop for defer<'self> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
error!("%?", self.x);
|
||||
error2!("{:?}", self.x);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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() {
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
});
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ use std::either::{Either, Left, Right};
|
||||
*x = Right(1.0);
|
||||
*z
|
||||
}
|
||||
_ => fail!()
|
||||
_ => fail2!()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ pub fn main() {
|
||||
}
|
||||
}
|
||||
let z = tail[0].clone();
|
||||
info!(fmt!("%?", z));
|
||||
info2!("{:?}", z);
|
||||
}
|
||||
_ => {
|
||||
unreachable!();
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ fn a() {
|
||||
[~ref _a] => {
|
||||
vec[0] = ~4; //~ ERROR cannot assign to `(*vec)[]` because it is borrowed
|
||||
}
|
||||
_ => fail!("foo")
|
||||
_ => fail2!("foo")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
}
|
@ -10,6 +10,6 @@
|
||||
|
||||
fn main() {
|
||||
match *1 { //~ ERROR: cannot be dereferenced
|
||||
_ => { fail!(); }
|
||||
_ => { fail2!(); }
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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"); }
|
||||
|
@ -15,7 +15,7 @@ mod foo {
|
||||
}
|
||||
|
||||
mod bar {
|
||||
fn x() { info!("x"); }
|
||||
fn x() { info2!("x"); }
|
||||
|
||||
pub fn y() { }
|
||||
}
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
// error-pattern:missing type
|
||||
|
||||
fn main() { fmt!("%+"); }
|
||||
fn main() { oldfmt!("%+"); }
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
// error-pattern:fmt! takes at least 1 argument
|
||||
|
||||
fn main() { fmt!(); }
|
||||
fn main() { oldfmt!(); }
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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"); }
|
||||
|
@ -12,4 +12,4 @@
|
||||
|
||||
extern mod extra;
|
||||
|
||||
fn main() { let s = fmt!("%s", "test", "test"); }
|
||||
fn main() { let s = oldfmt!("%s", "test", "test"); }
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
// error-pattern:unknown type
|
||||
|
||||
fn main() { fmt!("%w"); }
|
||||
fn main() { oldfmt!("%w"); }
|
||||
|
@ -12,5 +12,5 @@
|
||||
|
||||
fn main() {
|
||||
// Can't use a sign on unsigned conversions
|
||||
fmt!("%+u", 10u);
|
||||
oldfmt!("%+u", 10u);
|
||||
}
|
||||
|
@ -12,5 +12,5 @@
|
||||
|
||||
fn main() {
|
||||
// Can't use a space on unsigned conversions
|
||||
fmt!("% u", 10u);
|
||||
oldfmt!("% u", 10u);
|
||||
}
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
// error-pattern:unterminated conversion
|
||||
|
||||
fn main() { fmt!("%"); }
|
||||
fn main() { oldfmt!("%"); }
|
||||
|
@ -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); }
|
||||
|
@ -12,5 +12,5 @@
|
||||
|
||||
// error-pattern:unexpected token
|
||||
fn main() {
|
||||
fail!(@);
|
||||
fail2!(@);
|
||||
}
|
||||
|
@ -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]); }
|
||||
|
@ -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) };
|
||||
|
@ -12,5 +12,5 @@
|
||||
|
||||
fn main() {
|
||||
let a = if true { true };
|
||||
info!(a);
|
||||
info2!("{:?}", a);
|
||||
}
|
||||
|
@ -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"); }
|
||||
}
|
||||
|
||||
|
||||
|
@ -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; }
|
||||
}
|
||||
|
||||
|
@ -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(); }
|
||||
|
@ -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(); }
|
||||
|
@ -11,4 +11,4 @@
|
||||
// error-pattern: unresolved
|
||||
use main::bar;
|
||||
|
||||
fn main(args: ~[str]) { info!("foo"); }
|
||||
fn main(args: ~[str]) { info2!("foo"); }
|
||||
|
@ -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"); }
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -9,5 +9,5 @@
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
error!(x); //~ ERROR unresolved name `x`.
|
||||
error2!("{:?}", x); //~ ERROR unresolved name `x`.
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -10,4 +10,4 @@
|
||||
|
||||
// error-pattern: unresolved name `foobar`.
|
||||
|
||||
fn main(args: ~[str]) { info!(foobar); }
|
||||
fn main(args: ~[str]) { info2!("{:?}", foobar); }
|
||||
|
@ -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() {
|
||||
|
@ -15,5 +15,5 @@ struct cat {
|
||||
|
||||
fn main() {
|
||||
let kitty : cat = cat { x: () };
|
||||
error!(*kitty);
|
||||
error2!("{:?}", *kitty);
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ struct cat {
|
||||
|
||||
fn main() {
|
||||
let nyan = cat { foo: () };
|
||||
error!(*nyan);
|
||||
error2!("{:?}", *nyan);
|
||||
}
|
||||
|
@ -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() {}
|
||||
|
@ -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() {}
|
||||
|
@ -14,7 +14,7 @@ struct C {
|
||||
|
||||
impl Drop for C {
|
||||
fn drop(&mut self) {
|
||||
error!("dropping: %?", self.x);
|
||||
error2!("dropping: {:?}", self.x);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ fn siphash(k0 : u64) -> SipHash {
|
||||
//~^ ERROR unresolved name `k0`.
|
||||
}
|
||||
}
|
||||
fail!();
|
||||
fail2!();
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -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) {
|
||||
|
@ -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: ");
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -15,5 +15,5 @@ fn main() {
|
||||
Bar = foo //~ ERROR attempt to use a non-constant value in a constant
|
||||
}
|
||||
|
||||
error!(Bar);
|
||||
error2!("{:?}", Bar);
|
||||
}
|
||||
|
@ -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
|
||||
};
|
||||
}
|
||||
|
@ -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!();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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); }
|
||||
|
@ -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`
|
||||
});
|
||||
}
|
||||
|
@ -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()); }
|
||||
|
@ -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()); }
|
||||
|
@ -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
|
||||
|
@ -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; }
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -13,5 +13,5 @@ fn main() {
|
||||
let i: int;
|
||||
i //~ ERROR use of possibly uninitialized variable: `i`
|
||||
};
|
||||
error!(f());
|
||||
error2!("{:?}", f());
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ fn main() {
|
||||
let y: ~int = ~42;
|
||||
let mut x: ~int;
|
||||
loop {
|
||||
info!(y);
|
||||
info2!("{:?}", y);
|
||||
loop {
|
||||
loop {
|
||||
loop {
|
||||
|
@ -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`
|
||||
}
|
||||
|
@ -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
Loading…
x
Reference in New Issue
Block a user