summary refs log tree commit diff
path: root/src/libcollections/vec.rs
AgeCommit message (Collapse)AuthorLines
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
2014-09-14Check that the `min_align_of` the both types in a `PartialVec` matchesTobias Bucher-2/+6
This is important because the underlying allocator of the `Vec` passes that information to the deallocator which needs the guarantee that it is the same parameters that were also passed to the allocation function.
2014-09-14Fix some of the issues mentioned in the PR on GithubTobias Bucher-22/+43
This specifically includes: - Fix of the tests - Remove `transmute` between `Vec`s of different types
2014-09-14PartialVec: Remove TODOs and rename `unwrap` to `into_vec`Tobias Bucher-8/+4
2014-09-14Add support for in-place map for `Vec`s of types with same sizeTobias Bucher-0/+258
This is implemented using a new struct `PartialVec` which implements the proper drop semantics in case the conversion is interrupted by an unwind.
2014-09-13Move info into individual modules.Steve Klabnik-1/+3
2014-08-31Add unwrap method to MoveItemsJulian Orth-0/+25
2014-08-27Implement generalized object and type parameter bounds (Fixes #16462)Niko Matsakis-4/+12
2014-08-19A few minor documentation fixesP1start-28/+26
2014-08-18libsyntax: Remove the `use foo = bar` syntax from the language in favorPatrick Walton-1/+1
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change]
2014-08-16librustc: Forbid external crates, imports, and/or items from beingPatrick Walton-3/+1
declared with the same name in the same scope. This breaks several common patterns. First are unused imports: use foo::bar; use baz::bar; Change this code to the following: use baz::bar; Second, this patch breaks globs that import names that are shadowed by subsequent imports. For example: use foo::*; // including `bar` use baz::bar; Change this code to remove the glob: use foo::{boo, quux}; use baz::bar; Or qualify all uses of `bar`: use foo::{boo, quux}; use baz; ... baz::bar ... Finally, this patch breaks code that, at top level, explicitly imports `std` and doesn't disable the prelude. extern crate std; Because the prelude imports `std` implicitly, there is no need to explicitly import it; just remove such directives. The old behavior can be opted into via the `import_shadowing` feature gate. Use of this feature gate is discouraged. This implements RFC #116. Closes #16464. [breaking-change]
2014-08-13collections: Deprecate Vec::tailn. Same as slice_fromBrian Anderson-1/+2
2014-08-13core: Rename ImmutableSlice::unsafe_ref to unsafe_getBrian Anderson-3/+3
Deprecate the previous.
2014-08-13std: Rename slice::Vector to SliceBrian Anderson-6/+7
This required some contortions because importing both raw::Slice and slice::Slice makes rustc crash. Since `Slice` is in the prelude, this renaming is unlikely to casue breakage. [breaking-change]
2014-08-13std: Rename various slice traits for consistencyBrian Anderson-1/+1
ImmutableVector -> ImmutableSlice ImmutableEqVector -> ImmutableEqSlice ImmutableOrdVector -> ImmutableOrdSlice MutableVector -> MutableSlice MutableVectorAllocating -> MutableSliceAllocating MutableCloneableVector -> MutableCloneableSlice MutableOrdVector -> MutableOrdSlice These are all in the prelude so most code will not break. [breaking-change]
2014-08-12Deprecation fallout in libcollectionsAaron Turon-0/+1
2014-08-07fix grammar in Vec.retain's doc commentNathan Froyd-1/+1
2014-08-02fix underflow in vec swap_removeAlexis Beingessner-1/+7
fixes #16200