Skip to content

Commit 02e804b

Browse files
committed
test: Fix some broken test cases
1 parent fe9294e commit 02e804b

10 files changed

+20
-6
lines changed

src/test/run-pass/borrowck-preserve-box-in-arm-not-taken.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
fn main() {
1414
let x: @mut @Option<~int> = @mut @None;
1515
match x {
16-
@@Some(y) => {
16+
@@Some(ref y) => {
1717
// here, the refcount of `*x` is bumped so
1818
// `y` remains valid even if `*x` is modified.
1919
*x = @None;
@@ -24,4 +24,4 @@ fn main() {
2424
// works.
2525
}
2626
}
27-
}
27+
}

src/test/run-pass/boxed-trait-with-vstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
trait Foo {
12-
fn foo() {}
12+
fn foo();
1313
}
1414

1515
impl int : Foo {

src/test/run-pass/default-method-simple.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait Foo {
1214
fn f() {
1315
io::println("Hello!");

src/test/run-pass/issue-2718.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ mod pingpong {
220220

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

230230
fn liberate_pong(-p: pong) -> pipes::send_packet<ping> unsafe {
231231
let addr : *pipes::send_packet<ping> = match &p {
232-
&pong(x) => { cast::transmute(ptr::addr_of(&x)) }
232+
&pong(ref x) => { cast::transmute(ptr::addr_of(x)) }
233233
};
234234
let liberated_value = move *addr;
235235
cast::forget(move p);

src/test/run-pass/issue-3683.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait Foo {
1214
fn a() -> int;
1315
fn b() -> int {

src/test/run-pass/trait-default-method-bound-subst3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait A {
1214
fn g<T>(x: T, y: T) -> (T, T) { (move x, move y) }
1315
}

src/test/run-pass/trait-default-method-bound-subst4.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait A<T> {
1214
fn g(x: uint) -> uint { move x }
1315
}

src/test/run-pass/trait-default-method-bound.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait A {
1214
fn g() -> int { 10 }
1315
}

src/test/run-pass/traits-default-method-macro.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait Foo {
1214
fn bar() -> ~str {
1315
fmt!("test")
@@ -24,4 +26,4 @@ impl Baz: Foo {
2426
fn main() {
2527
let q = Quux;
2628
assert q.bar() == ~"test";
27-
}
29+
}

src/test/run-pass/traits-default-method-trivial.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[allow(default_methods)];
12+
1113
trait Cat {
1214
fn meow() -> bool;
1315
fn scratch() -> bool;

0 commit comments

Comments
 (0)