Skip to content

Commit 83a55ea

Browse files
committed
Fix some compile-fail tests
1 parent c19c24d commit 83a55ea

File tree

6 files changed

+6
-7
lines changed

6 files changed

+6
-7
lines changed

src/test/compile-fail/class-cast-to-trait.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// error-pattern: attempted access of field `eat` on type `@noisy`
21
trait noisy {
32
fn speak();
43
}
@@ -50,5 +49,5 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
5049

5150
fn main() {
5251
let nyan : noisy = cat(0, 2, ~"nyan") as noisy;
53-
nyan.eat();
52+
nyan.eat(); //~ ERROR type `@noisy` does not implement any method in scope named `eat`
5453
}

src/test/compile-fail/issue-1871.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ fn main() {
44
let f = 42;
55

66
let _g = if f < 5 {
7-
f.honk() //~ ERROR attempted access of field `honk`
7+
f.honk() //~ ERROR does not implement any method in scope named `honk`
88
}
99
else {
1010
()

src/test/compile-fail/issue-1896-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn createClosure (closedUint: uint) -> boxedFn {
77
fn main () {
88
let aFn: boxedFn = createClosure(10);
99

10-
let myInt: uint = aFn.theFn();
10+
let myInt: uint = (aFn.theFn)();
1111

1212
assert myInt == 10;
1313
}

src/test/compile-fail/issue-2149.rs

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

src/test/compile-fail/pure-loop-body.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pure fn range2(from: uint, to: uint, f: fn(uint)) {
1414

1515
pure fn range3(from: uint, to: uint, f: {x: fn(uint)}) {
1616
for range(from, to) |i| {
17-
f.x(i*2u); //~ ERROR access to impure function prohibited
17+
(f.x)(i*2u); //~ ERROR access to impure function prohibited
1818
}
1919
}
2020

src/test/compile-fail/regions-steal-closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ fn main() {
1111
let mut i = 3;
1212
box_it(|| i += 1) //~ ERROR cannot infer an appropriate lifetime
1313
};
14-
cl_box.cl();
14+
(cl_box.cl)();
1515
}

0 commit comments

Comments
 (0)