Skip to content

Commit b0278f5

Browse files
Elly Jonesbrson
Elly Jones
authored andcommitted
vec: take [mutable? T] instead of [T]
1 parent 230b279 commit b0278f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/vec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ mod unsafe {
796796
modifing its buffers, so it is up to the caller to ensure that
797797
the vector is actually the specified size.
798798
*/
799-
unsafe fn set_len<T>(&v: [T], new_len: uint) {
799+
unsafe fn set_len<T>(&v: [mutable? T], new_len: uint) {
800800
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
801801
(**repr).fill = new_len * sys::size_of::<T>();
802802
}
@@ -812,7 +812,7 @@ mod unsafe {
812812
Modifying the vector may cause its buffer to be reallocated, which
813813
would also make any pointers to it invalid.
814814
*/
815-
unsafe fn to_ptr<T>(v: [T]) -> *T {
815+
unsafe fn to_ptr<T>(v: [mutable? T]) -> *T {
816816
let repr: **vec_repr = ::unsafe::reinterpret_cast(addr_of(v));
817817
ret ::unsafe::reinterpret_cast(addr_of((**repr).data));
818818
}

0 commit comments

Comments
 (0)