about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2011-03-24 17:21:09 -0700
committerPatrick Walton <pcwalton@mimiga.net>2011-03-24 17:22:07 -0700
commitaf3d0d1848116f0e29dcaf8859d27fd4555f3444 (patch)
tree18984d72de2f122692b820259e06504621c42842 /src/lib
parent29d853dd19a67c77ee6e03653a02289b6319abc3 (diff)
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')
-rw-r--r--src/lib/_vec.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/_vec.rs b/src/lib/_vec.rs
index 36b529cc070..c3fc7035a84 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] {