about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-23 18:50:00 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-24 12:36:51 -0700
commit856acbf66d21a20bd115f11c55c7abecd1f4c92e (patch)
treea72941a31d110bf53eb9d99d86a56c636576ceca /src/lib
parente5d5682065eac04322bb1cc21c1cd672393c6c33 (diff)
downloadrust-856acbf66d21a20bd115f11c55c7abecd1f4c92e.tar.gz
rust-856acbf66d21a20bd115f11c55c7abecd1f4c92e.zip
Vectors containing pinned kinds become pinned
Otherwise they could be copied
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/either.rs6
-rw-r--r--src/lib/vec.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/either.rs b/src/lib/either.rs
index 143f0cabe92..d20b124a968 100644
--- a/src/lib/either.rs
+++ b/src/lib/either.rs
@@ -10,7 +10,7 @@ fn either<T, U,
     alt value { left(l) { f_left(l) } right(r) { f_right(r) } }
 }
 
-fn lefts<T, U>(eithers: [t<T, U>]) -> [T] {
+fn lefts<@T, U>(eithers: [t<T, U>]) -> [T] {
     let result: [T] = [];
     for elt: t<T, U> in eithers {
         alt elt { left(l) { result += [l]; } _ {/* fallthrough */ } }
@@ -18,7 +18,7 @@ fn lefts<T, U>(eithers: [t<T, U>]) -> [T] {
     ret result;
 }
 
-fn rights<T, U>(eithers: [t<T, U>]) -> [U] {
+fn rights<T, @U>(eithers: [t<T, U>]) -> [U] {
     let result: [U] = [];
     for elt: t<T, U> in eithers {
         alt elt { right(r) { result += [r]; } _ {/* fallthrough */ } }
@@ -26,7 +26,7 @@ fn rights<T, U>(eithers: [t<T, U>]) -> [U] {
     ret result;
 }
 
-fn partition<T, U>(eithers: [t<T, U>]) -> {lefts: [T], rights: [U]} {
+fn partition<@T, @U>(eithers: [t<T, U>]) -> {lefts: [T], rights: [U]} {
     let lefts: [T] = [];
     let rights: [U] = [];
     for elt: t<T, U> in eithers {
diff --git a/src/lib/vec.rs b/src/lib/vec.rs
index fef91259b50..84bd02e3689 100644
--- a/src/lib/vec.rs
+++ b/src/lib/vec.rs
@@ -343,7 +343,7 @@ iter iter2<@T>(v: [T]) -> (uint, T) {
 mod unsafe {
     type vec_repr = {mutable fill: uint, mutable alloc: uint, data: u8};
 
-    fn from_buf<T>(ptr: *T, elts: uint) -> [T] {
+    fn from_buf<@T>(ptr: *T, elts: uint) -> [T] {
         ret rustrt::vec_from_buf_shared(ptr, elts);
     }