Skip to content

Commit a407f74

Browse files
committed
Update and un-xfail reflect-visit-data
1 parent e8e143b commit a407f74

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

src/test/run-pass/reflect-visit-data.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// FIXME: un-xfail after snapshot
2-
// xfail-test
31

42
import intrinsic::{tydesc, get_tydesc, visit_tydesc, ty_visitor};
53
import libc::c_void;
@@ -32,16 +30,16 @@ impl ptr_visitor<V: ty_visitor movable_ptr>
3230

3331
#[inline(always)]
3432
fn bump(sz: uint) {
35-
self.inner.move_ptr() {|p|
33+
do self.inner.move_ptr() |p| {
3634
((p as uint) + sz) as *c_void
37-
}
35+
};
3836
}
3937

4038
#[inline(always)]
4139
fn align(a: uint) {
42-
self.inner.move_ptr() {|p|
40+
do self.inner.move_ptr() |p| {
4341
align(p as uint, a) as *c_void
44-
}
42+
};
4543
}
4644

4745
#[inline(always)]
@@ -247,9 +245,9 @@ impl ptr_visitor<V: ty_visitor movable_ptr>
247245
}
248246

249247
fn visit_vec(mtbl: uint, inner: *tydesc) -> bool {
250-
self.align_to::<[u8]>();
248+
self.align_to::<~[u8]>();
251249
if ! self.inner.visit_vec(mtbl, inner) { ret false; }
252-
self.bump_past::<[u8]>();
250+
self.bump_past::<~[u8]>();
253251
true
254252
}
255253

@@ -407,7 +405,7 @@ impl ptr_visitor<V: ty_visitor movable_ptr>
407405

408406
fn visit_trait() -> bool {
409407
self.align_to::<ty_visitor>();
410-
if ! self.inner.visit_iface() { ret false; }
408+
if ! self.inner.visit_trait() { ret false; }
411409
self.bump_past::<ty_visitor>();
412410
true
413411
}
@@ -492,16 +490,16 @@ impl of ty_visitor for my_visitor {
492490
fn visit_bot() -> bool { true }
493491
fn visit_nil() -> bool { true }
494492
fn visit_bool() -> bool {
495-
self.get::<bool>() {|b|
493+
do self.get::<bool>() |b| {
496494
self.vals += ~[bool::to_str(b)];
497-
}
498-
true
495+
};
496+
true
499497
}
500498
fn visit_int() -> bool {
501-
self.get::<int>() {|i|
499+
do self.get::<int>() |i| {
502500
self.vals += ~[int::to_str(i, 10u)];
503-
}
504-
true
501+
};
502+
true
505503
}
506504
fn visit_i8() -> bool { true }
507505
fn visit_i16() -> bool { true }
@@ -623,9 +621,9 @@ fn main() {
623621
let v = v as ty_visitor;
624622
visit_tydesc(td, v);
625623

626-
for (copy u.vals).each {|s|
624+
for (copy u.vals).each |s| {
627625
io::println(#fmt("val: %s", s));
628626
}
629627
#error("%?", copy u.vals);
630-
assert u.vals == ["1", "2", "3", "true", "false", "5", "4", "3"];
628+
assert u.vals == ~["1", "2", "3", "true", "false", "5", "4", "3"];
631629
}

0 commit comments

Comments
 (0)