core: Resolve and remove some FIXMEs

This commit is contained in:
Brian Anderson 2012-03-16 16:46:24 -07:00
parent 9e9f4a6240
commit 3445454e79
2 changed files with 1 additions and 10 deletions

View File

@ -106,8 +106,6 @@ native mod rustrt {
fn str_reserve_shared(&ss: str, nn: libc::size_t); fn str_reserve_shared(&ss: str, nn: libc::size_t);
} }
// FIXME: add pure to a lot of functions
/* /*
Section: Creating a string Section: Creating a string
*/ */

View File

@ -94,9 +94,7 @@ type init_op<T> = fn(uint) -> T;
#[doc = "Returns true if a vector contains no elements"] #[doc = "Returns true if a vector contains no elements"]
pure fn is_empty<T>(v: [const T]) -> bool { pure fn is_empty<T>(v: [const T]) -> bool {
// FIXME: This would be easier if we could just call len len(v) == 0u
for t: T in v { ret false; }
ret true;
} }
#[doc = "Returns true if a vector contains some elements"] #[doc = "Returns true if a vector contains some elements"]
@ -154,8 +152,6 @@ fn from_elem<T: copy>(n_elts: uint, t: T) -> [T] {
ret v; ret v;
} }
// FIXME: Possible typestate postcondition:
// len(result) == len(v) (needs issue #586)
#[doc = "Produces a mutable vector from an immutable vector."] #[doc = "Produces a mutable vector from an immutable vector."]
fn to_mut<T>(+v: [T]) -> [mutable T] unsafe { fn to_mut<T>(+v: [T]) -> [mutable T] unsafe {
let r = ::unsafe::reinterpret_cast(v); let r = ::unsafe::reinterpret_cast(v);
@ -185,9 +181,6 @@ fn tailn<T: copy>(v: [const T], n: uint) -> [T] {
slice(v, n, len(v)) slice(v, n, len(v))
} }
// FIXME: This name is sort of confusing next to from_fn, etc
// but this is the name haskell uses for this function,
// along with head/tail/last.
#[doc = "Returns all but the last elemnt of a vector"] #[doc = "Returns all but the last elemnt of a vector"]
fn init<T: copy>(v: [const T]) -> [T] { fn init<T: copy>(v: [const T]) -> [T] {
assert len(v) != 0u; assert len(v) != 0u;