summary refs log tree commit diff
path: root/src/liballoc/vec.rs
AgeCommit message (Collapse)AuthorLines
2018-01-24Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichtonbors-1/+1
Make core::ops::Place an unsafe trait Consumers of `Place` would reasonably expect that the `pointer` function returns a valid pointer to memory that can actually be written to.
2018-01-20Rename std::ptr::Shared to NonNullSimon Sapin-5/+5
`Shared` is now a deprecated `type` alias. CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
2018-01-09Make core::ops::Place an unsafe traitTaylor Cramer-1/+1
2018-01-01Fix panic condition docs for Vec::insert.Corey Farwell-1/+1
Fixes https://github.com/rust-lang/rust/issues/47065.
2017-12-20Clarify vec docs on deallocation (fixes #46879)Manish Goregaokar-2/+4
2017-12-16Move PhantomData<T> from Shared<T> to users of both Shared and #[may_dangle]Simon Sapin-0/+3
After discussing [1] today with @pnkfelix and @Gankro, we concluded that it’s ok for drop checking not to be much smarter than the current `#[may_dangle]` design which requires an explicit unsafe opt-in. [1] https://github.com/rust-lang/rust/issues/27730#issuecomment-316432083
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-11-21fix some typosMartin Lindhe-1/+1
2017-11-03Remove unused AsciiExt imports and fix tests related to ascii methodsLukas Kalbertodt-2/+0
Many AsciiExt imports have become useless thanks to the inherent ascii methods added in the last commits. These were removed. In some places, I fully specified the ascii method being called to enforce usage of the AsciiExt trait. Note that some imports are not removed but tagged with a `#[cfg(stage0)]` attribute. This is necessary, because certain ascii methods are not yet available in stage0. All those imports will be removed later. Additionally, failing tests were fixed. The test suite should exit successfully now.
2017-10-09usize index message for vecGuillaume Gomez-1/+24
2017-10-01Resolves #36284 - vec.rs documentationSean Prashad-5/+1
2017-09-24Backport libs stabilizations to 1.21 betaDavid Tolnay-6/+6
This includes the following stabilizations: - tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563 - iterator_for_each https://github.com/rust-lang/rust/pull/44567 - ord_max_min https://github.com/rust-lang/rust/pull/44593 - compiler_fences https://github.com/rust-lang/rust/pull/44595 - needs_drop https://github.com/rust-lang/rust/pull/44639 - vec_splice https://github.com/rust-lang/rust/pull/44640
2017-09-20Auto merge of #44355 - Xaeroxe:optimize_drain_filter, r=alexcrichtonbors-1/+7
Optimize drain_filter This PR cuts out two copies from each iteration of `drain_filter` by exchanging the swap operation for a copy_nonoverlapping function call instead. Since the data being swapped is not needed anymore we can just overwrite it instead.
2017-09-18Add requested commentJacob Kiesel-0/+3
2017-09-17stabilized vec_splice (fixes #32310)Michal Budzynski-7/+6
2017-09-14Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnikCorey Farwell-0/+1
Fix example in transmute; add safety requirement to Vec::from_raw_parts This fixes the second bullet point on #44281 and also removes some incorrect information.
2017-09-13Fix example in transmute; add safety requirement to Vec::from_raw_partsHavvy-0/+1
2017-09-12Fix drain_filter doctest.David Adler-3/+6
2017-09-11Try using ref to raw conversionJacob Kiesel-2/+2
2017-09-05Fix ownership issuesJacob Kiesel-1/+3
2017-09-05Remove unneeded copyJacob Kiesel-1/+2
2017-08-16Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, ↵bors-2/+2
r=Mark-Simulacrum use field init shorthand EVERYWHERE Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_. r? @Mark-Simulacrum
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Auto merge of #43245 - Gankro:drain-filter, r=sfacklerbors-0/+113
Add Vec::drain_filter This implements the API proposed in #43244. So I spent like half a day figuring out how to implement this in some awesome super-optimized unsafe way, which had me very confident this was worth putting into the stdlib. Then I looked at the impl for `retain`, and was like "oh dang". I compared the two and they basically ended up being the same speed. And the `retain` impl probably translates to DoubleEndedIter a lot more cleanly if we ever want that. So now I'm not totally confident this needs to go in the stdlib, but I've got two implementations and an amazingly robust test suite, so I figured I might as well toss it over the fence for discussion.
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
2017-07-26Rollup merge of #43455 - QuietMisdreavus:extend-spec-docs, r=steveklabnikMark Simulacrum-0/+6
add a note to Vec's Extend<&T> impl about its slice specialization From the regular documentation view, it's not at all apparent that [this specialization](https://github.com/rust-lang/rust/blob/5669c9988f50788b5ab5dee2d4538519d4e5663d/src/liballoc/vec.rs#L1879-L1891) exists for `slice::Iter`. This adds a documentation blurb to the Extend impl itself to note that this optimization exists.
2017-07-25add a note to Vec's Extend<&T> impl about its slice specializationQuietMisdreavus-0/+6
2017-07-22Add conversions from references to NonZero pointers, Unique, and SharedSimon Sapin-1/+1
2017-07-22Rename {NonZero,Shared,Unique}::new to new_uncheckedSimon Sapin-2/+2
2017-07-19Add Vec::drain_filterAlexis Beingessner-0/+113
2017-07-05Auto merge of #43050 - stjepang:doc-vec-fix-parens, r=frewsxcvbors-1/+1
Minor fix in docs for Vec Added missing parentheses after `mem::size_of::<T>`.
2017-07-04Minor fix in docs for VecStjepan Glavina-1/+1
2017-07-03Document unintuitive argument order for Vec::dedup_by relationAnders Kaseorg-4/+7
When trying to use dedup_by to merge some auxiliary information from removed elements into kept elements, I was surprised to observe that vec.dedup_by(same_bucket) calls same_bucket(a, b) where b appears before a in the vector, and discards a when true is returned. This argument order is probably a bug, but since it has already been stabilized, I guess we should document it as a feature and move on. (Vec::dedup also uses == with this unexpected argument order, but I figure that’s not important since == is expected to be symmetric with no side effects.) Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-2/+3
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-24Stabilize RangeArgumentSteven Fackler-3/+2
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-23Removed as many "```ignore" as possible.kennytm-1/+1
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-17Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`Oliver Middleton-4/+6
2017-06-13Merge crate `collections` into `alloc`Murarth-0/+2593