From 945d57a6ff8d31337bf6cdedcfa6c4a03d9f1ddc Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Thu, 11 Oct 2012 17:58:45 -0700 Subject: Export VecUnboxedRepr from vec so a test case can use it --- src/libcore/reflect.rs | 2 +- src/libcore/repr.rs | 5 +++-- src/libcore/vec.rs | 14 +++++++------- 3 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/libcore') 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 MovePtrAdaptor: TyVisitor { } fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool { - self.align_to::(); + self.align_to::(); 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:: |b| { + do self.get:: |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(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 -- cgit 1.4.1-3-g733a5