diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-11 17:58:45 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-11 17:58:45 -0700 |
| commit | 945d57a6ff8d31337bf6cdedcfa6c4a03d9f1ddc (patch) | |
| tree | 1d77be7634a9c56ddd6091114c85658b89ed6764 /src/libcore | |
| parent | 3c1ff31f4a70b6bd7840cf75af9395aedfac060b (diff) | |
Export VecUnboxedRepr from vec so a test case can use it
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/reflect.rs | 2 | ||||
| -rw-r--r-- | src/libcore/repr.rs | 5 | ||||
| -rw-r--r-- | src/libcore/vec.rs | 14 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/libcore/reflect.rs b/src/libcore/reflect.rs index 505804b3da8..3fa37a2fb8e 100644 --- a/src/libcore/reflect.rs +++ b/src/libcore/reflect.rs @@ -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 } diff --git a/src/libcore/repr.rs b/src/libcore/repr.rs index 0501b032d2d..2003949d631 100644 --- a/src/libcore/repr.rs +++ b/src/libcore/repr.rs @@ -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); } } diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 69b38c86f95..b242ed5aee4 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -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 |
