diff options
Diffstat (limited to 'src/libdebug')
| -rw-r--r-- | src/libdebug/reflect.rs | 5 | ||||
| -rw-r--r-- | src/libdebug/repr.rs | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/libdebug/reflect.rs b/src/libdebug/reflect.rs index 3a12aec39a1..cd94829f354 100644 --- a/src/libdebug/reflect.rs +++ b/src/libdebug/reflect.rs @@ -18,6 +18,7 @@ Runtime type reflection use std::intrinsics::{Disr, Opaque, TyDesc, TyVisitor}; use std::mem; +use std::gc::Gc; /** * Trait for visitor that wishes to reflect on data. @@ -219,9 +220,9 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> { } fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool { - self.align_to::<@u8>(); + self.align_to::<Gc<u8>>(); if ! self.inner.visit_box(mtbl, inner) { return false; } - self.bump_past::<@u8>(); + self.bump_past::<Gc<u8>>(); true } diff --git a/src/libdebug/repr.rs b/src/libdebug/repr.rs index 83eb4adfa97..d6ae23c6d9a 100644 --- a/src/libdebug/repr.rs +++ b/src/libdebug/repr.rs @@ -288,7 +288,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> { _align: uint) -> bool { fail!(); } fn visit_box(&mut self, mtbl: uint, inner: *TyDesc) -> bool { - try!(self, self.writer.write(['@' as u8])); + try!(self, self.writer.write("box(GC) ".as_bytes())); self.write_mut_qualifier(mtbl); self.get::<&raw::Box<()>>(|this, b| { let p = &b.data as *() as *u8; @@ -591,6 +591,7 @@ fn test_repr() { use std::io::stdio::println; use std::char::is_alphabetic; use std::mem::swap; + use std::gc::GC; fn exact_test<T>(t: &T, e:&str) { let mut m = io::MemWriter::new(); @@ -605,7 +606,7 @@ fn test_repr() { exact_test(&1.234, "1.234f64"); exact_test(&("hello"), "\"hello\""); - exact_test(&(@10), "@10"); + exact_test(&(box(GC) 10), "box(GC) 10"); exact_test(&(box 10), "box 10"); exact_test(&(&10), "&10"); let mut x = 10; @@ -619,8 +620,8 @@ fn test_repr() { "&[\"hi\", \"there\"]"); exact_test(&(P{a:10, b:1.234}), "repr::P{a: 10, b: 1.234f64}"); - exact_test(&(@P{a:10, b:1.234}), - "@repr::P{a: 10, b: 1.234f64}"); + exact_test(&(box(GC) P{a:10, b:1.234}), + "box(GC) repr::P{a: 10, b: 1.234f64}"); exact_test(&(box P{a:10, b:1.234}), "box repr::P{a: 10, b: 1.234f64}"); |
