Skip to content

Commit 945d57a

Browse files
committed
Export VecUnboxedRepr from vec so a test case can use it
1 parent 3c1ff31 commit 945d57a

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/libcore/reflect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<V: TyVisitor MovePtr> MovePtrAdaptor<V>: TyVisitor {
246246
}
247247

248248
fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool {
249-
self.align_to::<vec::raw::UnboxedVecRepr>();
249+
self.align_to::<vec::UnboxedVecRepr>();
250250
if ! self.inner.visit_vec(mtbl, inner) { return false; }
251251
true
252252
}

src/libcore/repr.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ use to_str::ToStr;
1515
use cast::transmute;
1616
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
1717
use reflect::{MovePtr, MovePtrAdaptor};
18-
use vec::raw::{VecRepr, UnboxedVecRepr, SliceRepr};
18+
use vec::UnboxedVecRepr;
19+
use vec::raw::{VecRepr, SliceRepr};
1920
pub use box::raw::BoxRepr;
2021
use box::raw::BoxHeaderRepr;
2122

@@ -303,7 +304,7 @@ impl ReprVisitor : TyVisitor {
303304

304305

305306
fn visit_unboxed_vec(mtbl: uint, inner: *TyDesc) -> bool {
306-
do self.get::<vec::raw::UnboxedVecRepr> |b| {
307+
do self.get::<vec::UnboxedVecRepr> |b| {
307308
self.write_unboxed_vec_repr(mtbl, b, inner);
308309
}
309310
}

src/libcore/vec.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,13 @@ pub unsafe fn from_buf<T>(ptr: *T, elts: uint) -> ~[T] {
16711671
raw::from_buf_raw(ptr, elts)
16721672
}
16731673

1674+
/// The internal 'unboxed' representation of a vector
1675+
pub struct UnboxedVecRepr {
1676+
mut fill: uint,
1677+
mut alloc: uint,
1678+
data: u8
1679+
}
1680+
16741681
/// Unsafe operations
16751682
mod raw {
16761683

@@ -1680,13 +1687,6 @@ mod raw {
16801687
unboxed: UnboxedVecRepr
16811688
}
16821689

1683-
/// The internal 'unboxed' representation of a vector
1684-
pub struct UnboxedVecRepr {
1685-
mut fill: uint,
1686-
mut alloc: uint,
1687-
data: u8
1688-
}
1689-
16901690
pub type SliceRepr = {
16911691
mut data: *u8,
16921692
mut len: uint

0 commit comments

Comments
 (0)