about summary refs log tree commit diff
path: root/src/liballoc/vec_deque.rs
AgeCommit message (Collapse)AuthorLines
2018-05-24stabilize RangeBounds collections_range #30877Cory Sherman-2/+2
rename RangeBounds::start() -> start_bound() rename RangeBounds::end() -> end_bound()
2018-04-16Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundibors-1/+1
Replace manual iterator exhaust with for_each(drop) This originally added a dedicated method, `Iterator::exhaust`, and has since been replaced with `for_each(drop)`, which is more idiomatic. <del>This is just shorthand for `for _ in &mut self {}` or `while let Some(_) = self.next() {}`. This states the intent a lot more clearly than the identical code: run the iterator to completion. <del>At least personally, my eyes tend to gloss over `for _ in &mut self {}` without fully paying attention to what it does; having a `Drop` implementation akin to: <del>`for _ in &mut self {}; unsafe { free(self.ptr); }`</del> <del>Is not as clear as: <del>`self.exhaust(); unsafe { free(self.ptr); }` <del>Additionally, I've seen debate over whether `while let Some(_) = self.next() {}` or `for _ in &mut self {}` is more clear, whereas `self.exhaust()` is clearer than both.
2018-04-14Cleanup liballoc use statementsMike Hommey-3/+2
Some modules were still using the deprecated `allocator` module, use the `alloc` module instead. Some modules were using `super` while it's not needed. Some modules were more or less ordering them, and other not, so the latter have been modified to match the others.
2018-04-04Replace manual iter exhaust with for_each(drop).Clar Charr-1/+1
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-143/+1
Closes #22181, #27779
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-3/+2
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-1/+1
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-27Implement `shrink_to` method on collectionsDiggory Blake-1/+34
2018-03-14implementing fallible allocation API (try_reserve) for Vec, String and HashMapsnf-0/+92
2018-03-03core: Update stability attributes for FusedIteratorUlrik Sverdrup-4/+4
2018-03-03core: Stabilize FusedIteratorUlrik Sverdrup-4/+4
FusedIterator is a marker trait that promises that the implementing iterator continues to return `None` from `.next()` once it has returned `None` once (and/or `.next_back()`, if implemented). The effects of FusedIterator are already widely available through `.fuse()`, but with stable `FusedIterator`, stable Rust users can implement this trait for their iterators when appropriate.
2018-01-24Auto merge of #47299 - cramertj:unsafe-placer, r=alexcrichtonbors-2/+2
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-21Rollup merge of #47595 - PieterPenninckx:master, r=shepmasterGuillaume Gomez-7/+8
Small improvements to the documentation of VecDeque. Some small improvements to the documentation of `VecDeque`.
2018-01-21Revert change to docs in panic section of VecDeque::split_offPieter Penninckx-1/+1
2018-01-20Auto merge of #46980 - ↵bors-1/+1
zackmdavis:and_the_case_of_the_needlessly_parenthesized_arguments, r=petrochenkov in which the unused-parens lint comes to cover function and method args Resolves #46137.
2018-01-20Rename std::ptr::Shared to NonNullSimon Sapin-3/+3
`Shared` is now a deprecated `type` alias. CC https://github.com/rust-lang/rust/issues/27730#issuecomment-352800629
2018-01-19Small improvements to the documentation of VecDeque.Pieter Penninckx-7/+8
2018-01-18in which the unused-parens lint comes to cover function and method argsZack M. Davis-1/+1
Resolves #46137.
2018-01-09Make core::ops::Place an unsafe traitTaylor Cramer-2/+2
2017-09-30address some `FIXME`s whose associated issues were marked as closedNiv Kaminer-1/+1
remove FIXME(#13101) since `assert_receiver_is_total_eq` stays. remove FIXME(#19649) now that stability markers render. remove FIXME(#13642) now the benchmarks were moved. remove FIXME(#6220) now that floating points can be formatted. remove FIXME(#18248) and write tests for `Rc<str>` and `Rc<[u8]>` remove reference to irelevent issues in FIXME(#1697, #2178...) update FIXME(#5516) to point to getopts issue 7 update FIXME(#7771) to point to RFC 628 update FIXME(#19839) to point to issue 26925
2017-09-23Fix capacity comparison in reserveSteven Fackler-1/+1
You can otherwise end up in a situation where you don't actually resize but still call into handle_cap_increase which then corrupts head/tail. Closes #44800
2017-09-18alloc: Implement rfold for VecDeque iteratorsUlrik Sverdrup-0/+16
2017-08-27Clarify that VecDeque::swap can panicDavid Ross-2/+4
The previous documentation mentioned this, but ambiguously used the term "fail". This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-08-01Fixed extra cases found in better checking.Isaac van Bakel-2/+2
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-1/+1
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-1/+1
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-13Merge crate `collections` into `alloc`Murarth-0/+2970