Skip to content

Commit 6157f1d

Browse files
committed
test: Fix some busted run-pass tests, fallout from the pattern bindings change. rs=bustage
1 parent e9e3d02 commit 6157f1d

File tree

5 files changed

+7
-26
lines changed

5 files changed

+7
-26
lines changed

src/test/run-pass/borrowck-preserve-box-in-discr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
fn main() {
44
let mut x = @{f: ~3};
5-
match *x {
6-
{f: b_x} => {
5+
match x {
6+
@{f: b_x} => {
77
assert *b_x == 3;
88
assert ptr::addr_of(&(*x.f)) == ptr::addr_of(&(*b_x));
99

@@ -14,4 +14,4 @@ fn main() {
1414
assert ptr::addr_of(&(*x.f)) != ptr::addr_of(&(*b_x));
1515
}
1616
}
17-
}
17+
}

src/test/run-pass/monad.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ trait option_monad<A> {
2020
impl<A> Option<A>: option_monad<A> {
2121
fn bind<B>(f: fn(A) -> Option<B>) -> Option<B> {
2222
match self {
23-
Some(a) => { f(a) }
23+
Some(ref a) => { f(*a) }
2424
None => { None }
2525
}
2626
}

src/test/run-pass/size-and-align.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ enum clam<T> { a(T, int), b, }
66

77
fn uhoh<T>(v: ~[clam<T>]) {
88
match v[1] {
9-
a::<T>(t, u) => { debug!("incorrect"); log(debug, u); fail; }
9+
a::<T>(ref t, ref u) => { debug!("incorrect"); log(debug, u); fail; }
1010
b::<T> => { debug!("correct"); }
1111
}
1212
}

src/test/run-pass/trait-cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl <T: to_str> Option<T>: to_str {
1515
fn to_str() -> ~str {
1616
match self {
1717
None => { ~"none" }
18-
Some(t) => { ~"some(" + t.to_str() + ~")" }
18+
Some(ref t) => { ~"some(" + t.to_str() + ~")" }
1919
}
2020
}
2121
}

src/test/run-pass/while-prelude-drop.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11

2+
#[deriving_eq]
23
enum t { a, b(~str), }
34

4-
impl t : cmp::Eq {
5-
pure fn eq(&self, other: &t) -> bool {
6-
match *self {
7-
a => {
8-
match (*other) {
9-
a => true,
10-
b(_) => false
11-
}
12-
}
13-
b(s0) => {
14-
match (*other) {
15-
a => false,
16-
b(s1) => s0 == s1
17-
}
18-
}
19-
}
20-
}
21-
pure fn ne(&self, other: &t) -> bool { !(*self).eq(other) }
22-
}
23-
245
fn make(i: int) -> t {
256
if i > 10 { return a; }
267
let mut s = ~"hello";

0 commit comments

Comments
 (0)