Fix some compile-fail tests
This commit is contained in:
parent
c19c24d193
commit
83a55ea73a
@ -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`
|
||||
}
|
||||
|
@ -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 {
|
||||
()
|
||||
|
@ -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;
|
||||
}
|
@ -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`
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user