Fix some compile-fail tests

This commit is contained in:
Brian Anderson 2012-12-01 15:59:04 -08:00
parent c19c24d193
commit 83a55ea73a
6 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,3 @@
// error-pattern: attempted access of field `eat` on type `@noisy`
trait noisy {
fn speak();
}
@ -50,5 +49,5 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
fn main() {
let nyan : noisy = cat(0, 2, ~"nyan") as noisy;
nyan.eat();
nyan.eat(); //~ ERROR type `@noisy` does not implement any method in scope named `eat`
}

View File

@ -4,7 +4,7 @@ fn main() {
let f = 42;
let _g = if f < 5 {
f.honk() //~ ERROR attempted access of field `honk`
f.honk() //~ ERROR does not implement any method in scope named `honk`
}
else {
()

View File

@ -7,7 +7,7 @@ fn createClosure (closedUint: uint) -> boxedFn {
fn main () {
let aFn: boxedFn = createClosure(10);
let myInt: uint = aFn.theFn();
let myInt: uint = (aFn.theFn)();
assert myInt == 10;
}

View File

@ -11,5 +11,5 @@ impl<A> ~[A]: vec_monad<A> {
}
}
fn main() {
["hi"].bind({|x| [x] }); //~ ERROR attempted access of field `bind`
["hi"].bind({|x| [x] }); //~ ERROR type `[&static/str]/1` does not implement any method in scope named `bind`
}

View File

@ -14,7 +14,7 @@ pure fn range2(from: uint, to: uint, f: fn(uint)) {
pure fn range3(from: uint, to: uint, f: {x: fn(uint)}) {
for range(from, to) |i| {
f.x(i*2u); //~ ERROR access to impure function prohibited
(f.x)(i*2u); //~ ERROR access to impure function prohibited
}
}

View File

@ -11,5 +11,5 @@ fn main() {
let mut i = 3;
box_it(|| i += 1) //~ ERROR cannot infer an appropriate lifetime
};
cl_box.cl();
(cl_box.cl)();
}