about summary refs log tree commit diff
path: root/src/libcollections/vec.rs
AgeCommit message (Collapse)AuthorLines
2014-10-27Test fixes and rebase conflicts from rollupAlex Crichton-1/+1
2014-10-27Add @thestinger comment explaining that shrink_to_fit might drop down as ↵areski-2/+4
close as possible but not to the minimun
2014-10-24Make the Vec data structure layout match raw::Slice.Clark Gaebel-9/+9
Fixes #18302 r? @thestinger
2014-10-23Improved examples on Vec documentationareski-1/+5
- shrink_to_fit example is now more clear by asserting the capacity value
2014-10-19Remove a large amount of deprecated functionalityAlex Crichton-191/+9
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
2014-10-15auto merge of #17934 : pcwalton/rust/better-autoderef-fixup, r=pnkfelixbors-4/+3
librustc: Improve method autoderef/deref/index behavior more, and enable IndexMut on mutable vectors. This fixes a bug whereby the mutability fixups for method behavior were not kicking in after autoderef failed to happen at any level. It also adds support for `Index` to the fixer-upper. Closes #12825. r? @pnkfelix
2014-10-14librustc: Improve method autoderef/deref/index behavior more, and enablePatrick Walton-4/+3
`IndexMut` on mutable vectors. This fixes a bug whereby the mutability fixups for method behavior were not kicking in after autoderef failed to happen at any level. It also adds support for `Index` to the fixer-upper. Closes #12825.
2014-10-13Clean up rustc warnings.NODA, Kai-22/+22
compiletest: compact "linux" "macos" etc.as "unix". liballoc: remove a superfluous "use". libcollections: remove invocations of deprecated methods in favor of their suggested replacements and use "_" for a loop counter. libcoretest: remove invocations of deprecated methods; also add "allow(deprecated)" for testing a deprecated method itself. libglob: use "cfg_attr". libgraphviz: add a test for one of data constructors. libgreen: remove a superfluous "use". libnum: "allow(type_overflow)" for type cast into u8 in a test code. librustc: names of static variables should be in upper case. libserialize: v[i] instead of get(). libstd/ascii: to_lowercase() instead of to_lower(). libstd/bitflags: modify AnotherSetOfFlags to use i8 as its backend. It will serve better for testing various aspects of bitflags!. libstd/collections: "allow(deprecated)" for testing a deprecated method itself. libstd/io: remove invocations of deprecated methods and superfluous "use". Also add #[test] where it was missing. libstd/num: introduce a helper function to effectively remove invocations of a deprecated method. libstd/path and rand: remove invocations of deprecated methods and superfluous "use". libstd/task and libsync/comm: "allow(deprecated)" for testing a deprecated method itself. libsync/deque: remove superfluous "unsafe". libsync/mutex and once: names of static variables should be in upper case. libterm: introduce a helper function to effectively remove invocations of a deprecated method. We still see a few warnings about using obsoleted native::task::spawn() in the test modules for libsync. I'm not sure how I should replace them with std::task::TaksBuilder and native::task::NativeTaskBuilder (dependency to libstd?) Signed-off-by: NODA, Kai <nodakai@gmail.com>
2014-10-12auto merge of #17942 : JIghtuse/rust/master, r=alexcrichtonbors-7/+0
[breaking-change] Closes #17916
2014-10-11Remove into_vec method from &[T]Boris Egorov-7/+0
[breaking-change] Closes #17916
2014-10-10Register new snapshotsAlex Crichton-44/+0
Also convert a number of `static mut` to just a plain old `static` and remove some unsafe blocks.
2014-10-10improve the performance of the vec![] macroDaniel Micay-1/+1
Closes #17865
2014-10-10implement Box<[T]> <-> Vec<T> conversionsDaniel Micay-0/+22
2014-10-10vec: minor cleanupDaniel Micay-2/+1
2014-10-09auto merge of #17870 : thestinger/rust/alloc, r=eddybbors-9/+6
Using reallocate(old_ptr, old_size, new_size, align) makes a lot more sense than reallocate(old_ptr, new_size, align, old_size) and matches up with the order used by existing platform APIs like mremap. Closes #17837 [breaking-change]
2014-10-08saner parameter order for reallocation functionsDaniel Micay-9/+6
Using reallocate(old_ptr, old_size, new_size, align) makes a lot more sense than reallocate(old_ptr, new_size, align, old_size) and matches up with the order used by existing platform APIs like mremap. Closes #17837 [breaking-change]
2014-10-08add #[experimental] as_string/as_vec functionsDaniel Micay-13/+63
This provides a way to pass `&[T]` to functions taking `&U` where `U` is a `Vec<T>`. This is useful in many cases not covered by the Equiv trait or methods like `find_with` on TreeMap.
2014-10-07Rename slicing methodsNick Cameron-1/+45
2014-10-07Rename slice::SliceNick Cameron-3/+3
2014-10-07Use slice syntax instead of slice_to, etc.Nick Cameron-25/+31
2014-10-02rollup merge of #16993 : dschatzberg/items-boundsAlex Crichton-15/+77
2014-10-02Revert "Use slice syntax instead of slice_to, etc."Aaron Turon-40/+28
This reverts commit 40b9f5ded50ac4ce8c9323921ec556ad611af6b7.
2014-10-02Revert "Remove the `_` suffix from slice methods."Aaron Turon-53/+0
This reverts commit df2f1fa7680a86ba228f004e7de731e91a1df1fe.
2014-10-02Revert "Review and rebasing changes"Aaron Turon-5/+10
This reverts commit 6e0611a48707a1f5d90aee32a02b2b15957ef25b.
2014-10-02Add fixes for new lifetime boundsDan Schatzberg-9/+6
2014-10-02Add tests for MoveItemsDan Schatzberg-0/+33
2014-10-02Use RawPtr::offset when size_of::<T>() > 0Dan Schatzberg-1/+5
2014-10-02Add lifetime bounds on Items and MutItems.Dan Schatzberg-14/+42
This also requires a fix for Vec's MoveItems. This resolves issue #16941
2014-10-02auto merge of #17620 : nick29581/rust/slice4, r=aturonbors-25/+85
cc @aturon r? anyone?
2014-10-02Review and rebasing changesNick Cameron-10/+5
2014-10-02auto merge of #17381 : tbu-/rust/pr_mapinplace2, r=aturonbors-208/+222
Additionally, support zero-sized types. Now there isn't a safe interface of `PartialVec` anymore, it's just a bare data structure with destructor that assumes you handled everything correctly before.
2014-10-02Remove the `_` suffix from slice methods.Nick Cameron-0/+53
Deprecates slicing methods from ImmutableSlice/MutableSlice in favour of slicing syntax or the methods in Slice/SliceMut. Closes #17273.
2014-10-02Use slice syntax instead of slice_to, etc.Nick Cameron-28/+40
2014-09-28Register new snapshotsSteven Fackler-3/+0
2014-09-22Fix deprecation warnings in check-docs.Victor Berger-0/+2
Fallout of closing #17185.
2014-09-21Fix fallout from Vec stabilizationAlex Crichton-39/+10
2014-09-21collections: Stabilize VecAlex Crichton-5/+56
The following methods, types, and names have become stable: * Vec * Vec::as_mut_slice * Vec::as_slice * Vec::capacity * Vec::clear * Vec::default * Vec::grow * Vec::insert * Vec::len * Vec::new * Vec::pop * Vec::push * Vec::remove * Vec::set_len * Vec::shrink_to_fit * Vec::truncate * Vec::with_capacity The following have become unstable: * Vec::dedup // naming * Vec::from_fn // naming and unboxed closures * Vec::get_mut // will be removed for IndexMut * Vec::grow_fn // unboxed closures and naming * Vec::retain // unboxed closures * Vec::swap_remove // uncertain naming * Vec::from_elem // uncertain semantics * vec::unzip // should be generic for all collections The following have been deprecated * Vec::append - call .extend() * Vec::append_one - call .push() * Vec::from_slice - call .to_vec() * Vec::grow_set - call .grow() and then .push() * Vec::into_vec - move the vector instead * Vec::move_iter - renamed to iter_move() * Vec::to_vec - call .clone() The following methods remain experimental pending conventions * vec::raw * vec::raw::from_buf * Vec:from_raw_parts * Vec::push_all This is a breaking change in terms of the signature of the `Vec::grow` function. The argument used to be taken by reference, but it is now taken by value. Code must update by removing a leading `&` sigil or by calling `.clone()` to create a value. [breaking-change]
2014-09-19Refactor `Vec::map_in_place` to move code out of `PartialVec`Tobias Bucher-208/+222
Additionally, support zero-sized types.
2014-09-19Implement slicing syntax.Nick Cameron-0/+80
`expr[]`, `expr[expr..]`, `expr[..expr]`,`expr[expr..expr]` Uses the Slice and SliceMut traits. Allows ... as well as .. in range patterns.
2014-09-16Fallout from renamingAaron Turon-36/+36
2014-09-16Align with _mut conventionsAaron Turon-7/+49
As per [RFC 52](https://github.com/rust-lang/rfcs/blob/master/active/0052-ownership-variants.md), use `_mut` suffixes to mark mutable variants, and `into_iter` for moving iterators. [breaking-change]
2014-09-16auto merge of #17266 : Gankro/rust/vec-move, r=alexcrichtonbors-0/+2
Seems to correctly report exact size, so it should claim to do so formally.
2014-09-16auto merge of #17280 : thestinger/rust/heap, r=pcwaltonbors-7/+3
2014-09-15heap: optimize EMPTY to avoid relocationsDaniel Micay-7/+3
Sized deallocation makes it pointless to provide an address that never overlaps with pointers returned by an allocator. Code can branch on the capacity of the allocation instead of a comparison with this sentinel. This improves the situation in #8859, and the remaining issues are only from the logging API, which should be disabled by default in optimized release builds anyway along with debug assertions. The remaining issues are part of #17081. Closes #8859
2014-09-15auto merge of #16887 : steveklabnik/rust/guide_iterators, r=alexcrichtonbors-1/+3
This isn't ready to merge yet. The 'containers and iterators' guide is basically just a collection of stuff that should be in the module definitions. So I'm moving the guide to just an 'iterators' guide, and moved the info that was there into the right places. So, is this a good path forward, and is all of the information still correct?
2014-09-14impl ExactSize for vec::MoveItemsAlexis Beingessner-0/+2
2014-09-14Fixed `map_in_place` tests after rustc upgradeTobias Bucher-8/+7
This replaces the now obsolete syntax `&[]` with `[].as_slice()`.
2014-09-14Added missing `}` from `map_in_place` rebaseTobias Bucher-0/+1
2014-09-14Remove the unused `Iterator` implementation of the private `PartialVec`Tobias Bucher-6/+0
2014-09-14Minimize the public interface and rename it to `map_in_place`Tobias Bucher-19/+21