From b0278f5315be8410d8fa93d83cb0de0ea0af1ed4 Mon Sep 17 00:00:00 2001 From: Elly Jones Date: Fri, 4 Nov 2011 20:27:37 -0400 Subject: [PATCH] vec: take [mutable? T] instead of [T] --- src/lib/vec.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/vec.rs b/src/lib/vec.rs index 5fbbb72d9f0..f1633194f90 100644 --- a/src/lib/vec.rs +++ b/src/lib/vec.rs @@ -796,7 +796,7 @@ mod unsafe { modifing its buffers, so it is up to the caller to ensure that the vector is actually the specified size. */ - unsafe fn set_len(&v: [T], new_len: uint) { + unsafe fn set_len(&v: [mutable? T], new_len: uint) { let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v)); (**repr).fill = new_len * sys::size_of::(); } @@ -812,7 +812,7 @@ mod unsafe { Modifying the vector may cause its buffer to be reallocated, which would also make any pointers to it invalid. */ - unsafe fn to_ptr(v: [T]) -> *T { + unsafe fn to_ptr(v: [mutable? T]) -> *T { let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v)); ret ::unsafe::reinterpret_cast(addr_of((**repr).data)); }