about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-01-06 10:23:55 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2012-01-06 17:40:05 +0100
commit7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04 (patch)
tree3b4781492ff8cb0458738f51ec9e601b5dee0d54 /src/libcore
parent295df68faf1e881d7fda09406f47bb99ef7f4d43 (diff)
downloadrust-7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04.tar.gz
rust-7c1f683c6d93cdb5fee8a664cd6b5ff2397e1d04.zip
Fix bug in method type parameter passing
It would occasionally pass the wrong type parameter, when calling
a generic method from a generic impl on a bounded param type.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/vec.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 32bb2f46a49..11dcce00d4c 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -195,6 +195,16 @@ fn tail<T: copy>(v: [const T]) : is_not_empty(v) -> [T] {
     ret slice(v, 1u, len(v));
 }
 
+/*
+Function tail_n
+
+Returns all but the first N elements of a vector
+*/
+
+fn tail_n<T: copy>(v: [const T], n: uint) -> [T] {
+    slice(v, n, len(v))
+}
+
 // FIXME: This name is sort of confusing next to init_fn, etc
 // but this is the name haskell uses for this function,
 // along with head/tail/last.