Export VecUnboxedRepr from vec so a test case can use it

This commit is contained in:
Tim Chevalier 2012-10-11 17:58:45 -07:00
parent 3c1ff31f4a
commit 945d57a6ff
3 changed files with 11 additions and 10 deletions

View File

@ -246,7 +246,7 @@ impl<V: TyVisitor MovePtr> MovePtrAdaptor<V>: TyVisitor {
}
fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool {
self.align_to::<vec::raw::UnboxedVecRepr>();
self.align_to::<vec::UnboxedVecRepr>();
if ! self.inner.visit_vec(mtbl, inner) { return false; }
true
}

View File

@ -15,7 +15,8 @@ use to_str::ToStr;
use cast::transmute;
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
use reflect::{MovePtr, MovePtrAdaptor};
use vec::raw::{VecRepr, UnboxedVecRepr, SliceRepr};
use vec::UnboxedVecRepr;
use vec::raw::{VecRepr, SliceRepr};
pub use box::raw::BoxRepr;
use box::raw::BoxHeaderRepr;
@ -303,7 +304,7 @@ impl ReprVisitor : TyVisitor {
fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool {
do self.get::<vec::raw::UnboxedVecRepr> |b| {
do self.get::<vec::UnboxedVecRepr> |b| {
self.write_unboxed_vec_repr(mtbl, b, inner);
}
}

View File

@ -1671,6 +1671,13 @@ pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
raw::from_buf_raw(ptr, elts)
}
/// The internal 'unboxed' representation of a vector
pub struct UnboxedVecRepr {
mut fill: uint,
mut alloc: uint,
data: u8
}
/// Unsafe operations
mod raw {
@ -1680,13 +1687,6 @@ mod raw {
unboxed: UnboxedVecRepr
}
/// The internal 'unboxed' representation of a vector
pub struct UnboxedVecRepr {
mut fill: uint,
mut alloc: uint,
data: u8
}
pub type SliceRepr = {
mut data: *u8,
mut len: uint