From 5e5ea0460879972dd9b78516cdee2e65be7fad93 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Sat, 27 Oct 2012 17:22:01 -0700 Subject: [PATCH] Make class-cast-to-trait compile (not sure why this worked before) --- src/test/compile-fail/class-cast-to-trait.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/compile-fail/class-cast-to-trait.rs index 5292e301ac01..70b1c4c9fbbd 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/compile-fail/class-cast-to-trait.rs @@ -7,7 +7,7 @@ struct cat { priv mut meows : uint, mut how_hungry : int, - name : str, + name : ~str, } impl cat { @@ -33,14 +33,14 @@ impl cat : noisy { priv impl cat { fn meow() { error!("Meow"); - self.meows += 1u; - if self.meows % 5u == 0u { + self.meows += 1; + if self.meows % 5 == 0 { self.how_hungry += 1; } } } -fn cat(in_x : uint, in_y : int, in_name: str) -> cat { +fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { cat { meows: in_x, how_hungry: in_y, @@ -49,6 +49,6 @@ fn cat(in_x : uint, in_y : int, in_name: str) -> cat { } fn main() { - let nyan : noisy = cat(0u, 2, "nyan") as noisy; + let nyan : noisy = cat(0, 2, ~"nyan") as noisy; nyan.eat(); }