diff options
| author | Patrick Walton <[email protected]> | 2011-03-24 17:21:09 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-24 17:22:07 -0700 |
| commit | af3d0d1848116f0e29dcaf8859d27fd4555f3444 (patch) | |
| tree | 18984d72de2f122692b820259e06504621c42842 /src/lib/_vec.rs | |
| parent | Remove obsolete Makefiles. (diff) | |
| download | rust-af3d0d1848116f0e29dcaf8859d27fd4555f3444.tar.xz rust-af3d0d1848116f0e29dcaf8859d27fd4555f3444.zip | |
rustc: Open "use"d crates; add a _vec.vec_from_buf() method along the way; XFAIL use-import-export.rs in rustc
Diffstat (limited to 'src/lib/_vec.rs')
| -rw-r--r-- | src/lib/_vec.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs index 36b529cc..c3fc7035 100644 --- a/src/lib/_vec.rs +++ b/src/lib/_vec.rs @@ -1,7 +1,7 @@ import option.none; import option.some; -import vbuf = rustrt.vbuf; +type vbuf = rustrt.vbuf; type operator2[T,U,V] = fn(&T, &U) -> V; @@ -28,6 +28,8 @@ native "rust" mod rustrt { fn refcount[T](vec[T] v) -> uint; fn vec_print_debug_info[T](vec[T] v); + + fn vec_from_vbuf[T](vbuf v, uint n_elts) -> vec[T]; } fn alloc[T](uint n_elts) -> vec[T] { @@ -48,6 +50,10 @@ fn refcount[T](vec[mutable? T] v) -> uint { } } +unsafe fn vec_from_vbuf[T](vbuf v, uint n_elts) -> vec[T] { + ret rustrt.vec_from_vbuf[T](v, n_elts); +} + type init_op[T] = fn(uint i) -> T; fn init_fn[T](&init_op[T] op, uint n_elts) -> vec[T] { |