test: Fix some broken test cases

This commit is contained in:
Patrick Walton 2012-12-17 14:57:37 -08:00
parent fe9294ef71
commit 02e804bba8
10 changed files with 20 additions and 6 deletions

View File

@ -13,7 +13,7 @@
fn main() {
let x: @mut @Option<~int> = @mut @None;
match x {
@@Some(y) => {
@@Some(ref y) => {
// here, the refcount of `*x` is bumped so
// `y` remains valid even if `*x` is modified.
*x = @None;
@ -24,4 +24,4 @@ fn main() {
// works.
}
}
}
}

View File

@ -9,7 +9,7 @@
// except according to those terms.
trait Foo {
fn foo() {}
fn foo();
}
impl int : Foo {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn f() {
io::println("Hello!");

View File

@ -220,7 +220,7 @@ mod pingpong {
fn liberate_ping(-p: ping) -> pipes::send_packet<pong> unsafe {
let addr : *pipes::send_packet<pong> = match &p {
&ping(x) => { cast::transmute(ptr::addr_of(&x)) }
&ping(ref x) => { cast::transmute(ptr::addr_of(x)) }
};
let liberated_value = move *addr;
cast::forget(move p);
@ -229,7 +229,7 @@ mod pingpong {
fn liberate_pong(-p: pong) -> pipes::send_packet<ping> unsafe {
let addr : *pipes::send_packet<ping> = match &p {
&pong(x) => { cast::transmute(ptr::addr_of(&x)) }
&pong(ref x) => { cast::transmute(ptr::addr_of(x)) }
};
let liberated_value = move *addr;
cast::forget(move p);

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn a() -> int;
fn b() -> int {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A {
fn g<T>(x: T, y: T) -> (T, T) { (move x, move y) }
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A<T> {
fn g(x: uint) -> uint { move x }
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait A {
fn g() -> int { 10 }
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Foo {
fn bar() -> ~str {
fmt!("test")
@ -24,4 +26,4 @@ impl Baz: Foo {
fn main() {
let q = Quux;
assert q.bar() == ~"test";
}
}

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#[allow(default_methods)];
trait Cat {
fn meow() -> bool;
fn scratch() -> bool;