summary refs log tree commit diff
path: root/src/libstd/vec.rs
AgeCommit message (Collapse)AuthorLines
2013-07-01auto merge of #7521 : thestinger/rust/vec, r=Aatchbors-12/+14
continued from #7495
2013-06-30auto merge of #7487 : huonw/rust/vec-kill, r=cmrbors-590/+251
Continuation of #7430. I haven't removed the `map` method, since the replacement `v.iter().transform(f).collect::<~[SomeType]>()` is a little ridiculous at the moment.
2013-06-30vec: implement exchange vector reserve in RustDaniel Micay-12/+14
2013-06-30auto merge of #7495 : thestinger/rust/exchange, r=cmrbors-1/+29
With these changes, exchange allocator headers are never initialized, read or written to. Removing the header will now just involve updating the code in trans using an offset to only do it if the type contained is managed. The only thing blocking removing the initialization of the last field in the header was ~fn since it uses it to store the dynamic size/types due to captures. I temporarily switched it to a `closure_exchange_alloc` lang item (it uses the same `exchange_free`) and #7496 is filed about removing that. Since the `exchange_free` call is now inlined all over the codebase, I don't think we should have an assert for null. It doesn't currently ever happen, but it would be fine if we started generating code that did do it. The `exchange_free` function also had a comment declaring that it must not fail, but a regular assert would cause a failure. I also removed the atomic counter because valgrind can already find these leaks, and we have valgrind bots now. Note that exchange free does not currently print an error an out-of-memory when it aborts, because our `io` code may allocate. We could probably get away with a `#[rust_stack]` call to a `stdio` function but it would be better to make a write system call.
2013-06-30Remove vec::{map, mapi, zip_map} and the methods, except for .map, since thisHuon Wilson-113/+18
is very common, and the replacement (.iter().transform().collect()) is very ugly.
2013-06-30Convert vec::{grow, grow_fn, grow_set} to methods.Huon Wilson-63/+46
2013-06-30Convert vec::dedup to a method.Huon Wilson-39/+34
2013-06-30Convert vec::{bsearch, bsearch_elem} to methods.Huon Wilson-79/+88
2013-06-30Convert vec::{reverse, swap} to methods.Huon Wilson-42/+44
2013-06-30Convert vec::{rposition, rposition_elem, position_elem, contains} to methods.Huon Wilson-44/+24
2013-06-30Remove vec::[r]position_between, replaced by slices & iterators.Huon Wilson-102/+8
2013-06-30Remove vec::{rfind, rfind_between, find_between}, replaced by slices and ↵Huon Wilson-119/+0
iterator adapators.
2013-06-30vec: use contains_managed instead of box headerDaniel Micay-1/+29
2013-06-29minor vec cleanupDaniel Micay-10/+6
* hide the rustrt module in the docs * remove the useless `traits` module wrapping the `Add` impl
2013-06-29Removing a lot of usage of '&const'Alex Crichton-52/+20
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-4/+4
for making them noncopyable.
2013-06-28Make default method handling not choke on self region params. Closes #7341.Michael Sullivan-2/+4
2013-06-28librustc: Disallow "mut" from distributing over bindings.Patrick Walton-3/+6
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-28std: silence some test warnings.Huon Wilson-2/+2
2013-06-28Convert vec::{reserve, reserve_at_least, capacity} to methods.Huon Wilson-71/+71
2013-06-28Convert vec::{partition, partitioned} to methods.Huon Wilson-47/+28
2013-06-28Convert vec::retain to a method.Huon Wilson-22/+18
2013-06-28Convert vec::truncate to a method.Huon Wilson-16/+11
2013-06-28Convert vec::{push, push_all, push_all_move} to methods.Huon Wilson-85/+75
2013-06-28Convert vec::{pop, shift, unshift, insert, remove, swap_remove} to methods.Huon Wilson-133/+101
2013-06-27Convert vec::{head, tail, init, last} (and similar fns) to methods.Huon Wilson-50/+26
2013-06-27Convert vec::[mut_]slice to methods, remove vec::const_slice.Huon Wilson-63/+37
2013-06-26vec: remove superseded reverse_part functionDaniel Micay-40/+2
`reverse(xs.mut_slice(a, b))` replaces `reverse_part(xs, a, b)`
2013-06-26Add methods .move_from() and .copy_from() to vecKevin Ballard-0/+73
Add method .move_from() to MutableVector, which consumes another vector and moves elements into the receiver. Add new trait MutableCloneableVector with one method .copy_from(), which clones elements from another vector into the receiver.
2013-06-26Add method .set_memory in vec::bytes for &[u8]Kevin Ballard-0/+26
Add new trait vec::bytes::MutableByteVector which currently defines one method .set_memory().
2013-06-25remove `each` from vec, HashMap and HashSetDaniel Micay-115/+7
2013-06-25auto merge of #7254 : Blei/rust/intrinsic-overhaul, r=cmrbors-4/+11
This sets the `get_tydesc()` return type correctly and removes the intrinsic module. See #3730, #3475. Update: this now also removes the unused shape fields in tydescs.
2013-06-25Remove stage0 cfgsJames Miller-2/+0
2013-06-24work around ICE from default methodDaniel Micay-2/+2
issue #7341
2013-06-24iterator: implement `collect` with FromIteratorDaniel Micay-0/+11
This makes it take advantage of the size hint for pre-allocation.
2013-06-24remove old_iterDaniel Micay-5/+4
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-23Remove intrinsic modulePhilipp Brüschweiler-4/+11
To achieve this, the following changes were made: * Move TyDesc, TyVisitor and Opaque to std::unstable::intrinsics * Convert TyDesc, TyVisitor and Opaque to lang items instead of specially handling the intrinsics module * Removed TypeDesc, FreeGlue and get_type_desc() from sys Fixes #3475.
2013-06-23vec: remove BaseIter implementationDaniel Micay-13/+3
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-22iterator: add a FromIterator traitDaniel Micay-1/+13
This is able to take advantage of the lower bound from the size hint.
2013-06-22iterator: add a size_hint default methodDaniel Micay-6/+21
also adds an implementation for the vector iterators
2013-06-21replace vec::find with the IteratorUtil methodDaniel Micay-41/+0
2013-06-21vec: replace `position` with `iter().position_`Daniel Micay-42/+4
2013-06-21vec: rm old_iter implementations, except BaseIterDaniel Micay-175/+12
The removed test for issue #2611 is well covered by the `std::iterator` module itself. This adds the `count` method to `IteratorUtil` to replace `EqIter`.
2013-06-21vec: remove eachiDaniel Micay-41/+0
replaced by the `enumerate` method from std::iterator
2013-06-21vec: remove each_constDaniel Micay-15/+0
An Iterator implementation can be made for &const [T] if it turns out to be necessary for some use case.
2013-06-21libstd: cleanup warningsJames Miller-1/+1
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-68/+68
2013-06-17auto merge of #7198 : huonw/rust/slice-zeros, r=Aatchbors-0/+22
2013-06-17std: add Zero impls for &[] and &str.Huon Wilson-0/+22
2013-06-16Add copies to type params with Copy boundNiko Matsakis-17/+17