mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 20:28:33 +00:00
Export VecUnboxedRepr from vec so a test case can use it
This commit is contained in:
parent
3c1ff31f4a
commit
945d57a6ff
@ -246,7 +246,7 @@ impl<V: TyVisitor MovePtr> MovePtrAdaptor<V>: TyVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool {
|
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; }
|
if ! self.inner.visit_vec(mtbl, inner) { return false; }
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,8 @@ use to_str::ToStr;
|
|||||||
use cast::transmute;
|
use cast::transmute;
|
||||||
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
|
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
|
||||||
use reflect::{MovePtr, MovePtrAdaptor};
|
use reflect::{MovePtr, MovePtrAdaptor};
|
||||||
use vec::raw::{VecRepr, UnboxedVecRepr, SliceRepr};
|
use vec::UnboxedVecRepr;
|
||||||
|
use vec::raw::{VecRepr, SliceRepr};
|
||||||
pub use box::raw::BoxRepr;
|
pub use box::raw::BoxRepr;
|
||||||
use box::raw::BoxHeaderRepr;
|
use box::raw::BoxHeaderRepr;
|
||||||
|
|
||||||
@ -303,7 +304,7 @@ impl ReprVisitor : TyVisitor {
|
|||||||
|
|
||||||
|
|
||||||
fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool {
|
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);
|
self.write_unboxed_vec_repr(mtbl, b, inner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1671,6 +1671,13 @@ pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
|
|||||||
raw::from_buf_raw(ptr, elts)
|
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
|
/// Unsafe operations
|
||||||
mod raw {
|
mod raw {
|
||||||
|
|
||||||
@ -1680,13 +1687,6 @@ mod raw {
|
|||||||
unboxed: UnboxedVecRepr
|
unboxed: UnboxedVecRepr
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The internal 'unboxed' representation of a vector
|
|
||||||
pub struct UnboxedVecRepr {
|
|
||||||
mut fill: uint,
|
|
||||||
mut alloc: uint,
|
|
||||||
data: u8
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type SliceRepr = {
|
pub type SliceRepr = {
|
||||||
mut data: *u8,
|
mut data: *u8,
|
||||||
mut len: uint
|
mut len: uint
|
||||||
|
Loading…
Reference in New Issue
Block a user