mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-22 12:43:36 +00:00
test: Fix some broken test cases
This commit is contained in:
parent
fe9294ef71
commit
02e804bba8
@ -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.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
trait Foo {
|
||||
fn foo() {}
|
||||
fn foo();
|
||||
}
|
||||
|
||||
impl int : Foo {
|
||||
|
@ -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!");
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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) }
|
||||
}
|
||||
|
@ -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 }
|
||||
}
|
||||
|
@ -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 }
|
||||
}
|
||||
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user