about summary refs log tree commit diff
path: root/src/liballoc
AgeCommit message (Collapse)AuthorLines
2018-12-08Use private trait for Rc/Arc Eq specializationThomas Heck-37/+74
2018-12-08Short-circuit Rc/Arc equality checking on equal pointers where T: EqJo Liss-5/+46
Closes #42655
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-22/+22
2018-12-07Fix broken doc testCorey Farwell-1/+1
2018-12-07Drain only needs a shared referenceRalf Jung-7/+5
2018-12-07VecDeque::drain: make sure the 'drain' raw pointer is actually still usableRalf Jung-2/+7
2018-12-07Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrumkennytm-18/+18
Replace usages of `..i + 1` ranges with `..=i`. Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-06Rollup merge of #56548 - Lucretiel:string-extend-optimize, r=sfacklerPietro Albini-18/+29
Optimized string FromIterator + Extend impls I noticed that there was a lost opportunity to reuse string buffers in `FromIterator<String>` and `FromIterator<Cow<str>>`; updated the implementations to use these. In practice this translates to at least one fewer allocation when using these APIs. Additionally, rewrote `Extend` implementations to use `iter.for_each`, which (supposedly) helps the compiler optimize those loops (because iterator adapters are encouraged to provide optimized implementations of `fold` and `try_fold`.
2018-12-06Rollup merge of #56500 - ljedrz:cleanup_rest_of_const_lifetimes, r=zackmdavisPietro Albini-1/+1
cleanup: remove static lifetimes from consts A follow-up to https://github.com/rust-lang/rust/pull/56497.
2018-12-05Added explainatory commentsNathan West-0/+6
2018-12-05Fixed mutabilityNathan West-4/+4
2018-12-05Rollup merge of #55987 - Thomasdezeeuw:weak-ptr_eq, r=sfacklerPietro Albini-1/+95
Add Weak.ptr_eq I hope the doc tests alone are good enough. We also might want to discuss the dangling pointer case (from `Weak::new()`). Updates #55981.
2018-12-05Optimized string FromIterator implsNathan West-18/+23
2018-12-05Fix typo in variable nameCorey Farwell-1/+1
2018-12-05Fix error in example by adding type annotationdaniellimws-1/+1
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-18/+18
2018-12-04Add example of using the indexing operator to BTreeMap docsCorey Farwell-0/+3
2018-12-04cleanup: remove static lifetimes from constsljedrz-1/+1
2018-12-03slice: tweak concat & joinljedrz-3/+3
2018-12-03Rollup merge of #56432 - ordovicia:shrink-to-issue, r=Centrilkennytm-4/+4
Update issue number of `shrink_to` methods to point the tracking issue Tracking issue: #56431
2018-12-03Rollup merge of #56401 - scottmcm:vecdeque-resize-with, r=dtolnaykennytm-33/+27
Move VecDeque::resize_with out of the impl<T:Clone> block I put this in the wrong `impl` block in https://github.com/rust-lang/rust/pull/56016, so fixing. Tracking issue for the unstable method: https://github.com/rust-lang/rust/issues/41758#issuecomment-443077953
2018-12-03Fix link in Weak::newThomas de Zeeuw-1/+2
2018-12-03Add sync::Weak::ptr_eqThomas de Zeeuw-0/+47
2018-12-03Add rc::Weak.ptr_eqThomas de Zeeuw-0/+46
2018-12-02Auto merge of #56275 - RalfJung:win-mutex, r=SimonSapinbors-2/+2
use MaybeUninit instead of mem::uninitialized for Windows Mutex I hope this builds, I do not have a Windows machine to test...
2018-12-02avoid MaybeUninit::get_mut where it is not neededRalf Jung-2/+2
2018-12-02Update issue number of `shrink_to` methods to point the tracking issueHidehito Yabuuchi-4/+4
2018-12-01Redo the docs for Vec::set_lenScott McMurray-27/+53
Inspired by the recent conversation on IRLO.
2018-11-30Move VecDeque::resize_with out of the impl<T:Clone> blockScott McMurray-33/+27
2018-12-01Rollup merge of #56131 - ljedrz:assorted, r=RalfJungkennytm-0/+2
Assorted tweaks - preallocate `VecDeque` in `Decodable::decode` (as it is done with other collections which can do it) - add a FIXME to `String::from_utf16` r? @RalfJung
2018-11-23Merge branch 'master' into frewsxcv-dynCorey Farwell-6/+20
2018-11-22Auto merge of #53918 - Havvy:doc-sort-by, r=GuillaumeGomezbors-0/+16
Doc total order requirement of sort(_unstable)_by I took the definition of what a total order is from the Ord trait docs. I specifically put "elements of the slice" because if you have a slice of f64s, but know none are NaN, then sorting by partial ord is total in this case. I'm not sure if I should give such an example in the docs or not. r? @GuillaumeGomez
2018-11-21update various stdlib docsSteve Klabnik-6/+4
2018-11-21String: add a FIXME to from_utf16ljedrz-0/+2
2018-11-20Incorporate `dyn` into more comments and docs.Corey Farwell-10/+10
2018-11-17Add VecDeque::resize_withScott McMurray-1/+39
2018-11-17Add double quotes to resolve errordaniellimws-1/+1
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-2/+2
fix various typos in doc comments
2018-11-15Rollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapinPietro Albini-1/+9
Speed up String::from_utf16 Collecting into a `Result` is idiomatic, but not necessarily fast due to rustc not being able to preallocate for the resulting collection. This is fine in case of an error, but IMO we should optimize for the common case, i.e. a successful conversion. This changes the behavior of `String::from_utf16` from collecting into a `Result` to pushing to a preallocated `String` in a loop. According to [my simple benchmark](https://gist.github.com/ljedrz/953a3fb74058806519bd4d640d6f65ae) this change makes `String::from_utf16` around **twice** as fast.
2018-11-13fix various typos in doc commentsAndy Russell-2/+2
2018-11-13Rollup merge of #55889 - RalfJung:global-alloc, r=alexcrichtonkennytm-0/+4
global allocators: add a few comments These comments answer some questions that came up when I tried to understand how the control flow works for the global allocator, `Global` and `System`. r? @alexcrichton
2018-11-13Rollup merge of #55874 - denisvasilik:docs, r=alexcrichtonkennytm-0/+41
string: Add documentation for `From` impls Hi this is part of #51430. I'm a first time contributor, so I started with a small task adding a bit of documentation for From impls.
2018-11-13Rollup merge of #55843 - Axary:master, r=sfacklerkennytm-1/+17
add FromIterator<A> to Box<[A]>
2018-11-13Rollup merge of #55711 - kngwyu:btreemap-rangemut-doc, r=Mark-Simulacrumkennytm-3/+4
Format BtreeMap::range_mut example Before: ![image](https://user-images.githubusercontent.com/16046705/48049184-36517780-e1e1-11e8-8da2-a3ae858d5a76.png) After: ![image](https://user-images.githubusercontent.com/16046705/48049210-45382a00-e1e1-11e8-87b3-84ae60ef798e.png)
2018-11-12global allocators: add a few commentsRalf Jung-0/+4
2018-11-11Minor style guide corrections.Denis Vasilik-6/+6
2018-11-11std: Delete the `alloc_system` crateAlex Crichton-4/+1
This commit deletes the `alloc_system` crate from the standard distribution. This unstable crate is no longer needed in the modern stable global allocator world, but rather its functionality is folded directly into the standard library. The standard library was already the only stable location to access this crate, and as a result this should not affect any stable code.
2018-11-11Whitespace cleanup according to Rust's style guidelines.Denis Vasilik-3/+3
2018-11-11Added comments for trait implementations.Denis Vasilik-1/+28
2018-11-11Added comment for From trait implementation: boxed string slice to StringDenis Vasilik-0/+14