Skip to content

Commit 5e5ea04

Browse files
committed
Make class-cast-to-trait compile (not sure why this worked before)
1 parent 64193a9 commit 5e5ea04

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct cat {
77
priv mut meows : uint,
88

99
mut how_hungry : int,
10-
name : str,
10+
name : ~str,
1111
}
1212

1313
impl cat {
@@ -33,14 +33,14 @@ impl cat : noisy {
3333
priv impl cat {
3434
fn meow() {
3535
error!("Meow");
36-
self.meows += 1u;
37-
if self.meows % 5u == 0u {
36+
self.meows += 1;
37+
if self.meows % 5 == 0 {
3838
self.how_hungry += 1;
3939
}
4040
}
4141
}
4242

43-
fn cat(in_x : uint, in_y : int, in_name: str) -> cat {
43+
fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat {
4444
cat {
4545
meows: in_x,
4646
how_hungry: in_y,
@@ -49,6 +49,6 @@ fn cat(in_x : uint, in_y : int, in_name: str) -> cat {
4949
}
5050

5151
fn main() {
52-
let nyan : noisy = cat(0u, 2, "nyan") as noisy;
52+
let nyan : noisy = cat(0, 2, ~"nyan") as noisy;
5353
nyan.eat();
5454
}

0 commit comments

Comments
 (0)