about summary refs log tree commit diff
path: root/src/liballoc/slice.rs
AgeCommit message (Collapse)AuthorLines
2019-04-15warn(missing_docs) in liballoc, and add missing docsRalf Jung-0/+10
2019-02-12Revert "Remove mentions of unstable sort_by_cached key from stable ↵Scott McMurray-0/+4
documentation" This reverts commit 9c7b69e17909ceb090a1c4b8882a4e0924a2a755.
2019-02-12Stabilize slice_sort_by_cached_keyScott McMurray-2/+1
2019-02-10libs: doc commentsAlexander Regueiro-3/+3
2019-02-03liballoc: revert nested imports style changes.Mazdak Farrokhzad-14/+11
2019-02-02liballoc: apply uniform_paths.Mazdak Farrokhzad-2/+2
2019-02-02liballoc: prefer imports of borrow from libcore.Mazdak Farrokhzad-1/+2
2019-02-02liballoc: adjust abolute imports + more import fixes.Mazdak Farrokhzad-3/+1
2019-02-02liballoc: refactor & fix some imports.Mazdak Farrokhzad-9/+12
2019-02-02liballoc: cargo check passes on 2018Mazdak Farrokhzad-6/+7
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-09Auto merge of #56463 - ljedrz:slice_concat_join, r=nikicbors-3/+3
slice: tweak concat & join - use `sum` instead of `fold` (readability) - adjust the capacity for `join` - the number of separators is `n - 1`, not `n`; proof: ``` fn main() { let a = [[1, 2], [4, 5]]; let v = a.join(&3); assert_ne!(v.len(), v.capacity()); // len is 5, capacity is 6 } ```
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-5/+5
2018-12-03slice: tweak concat & joinljedrz-3/+3
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-10-18Stabilize slice::rchunks(), rchunks_mut(), rchunks_exact(), rchunk_exact_mut()Sebastian Dröge-1/+1
Fixes #55177
2018-10-18Stabilize slice::chunks_exact() and slice::chunks_exact_mut()Sebastian Dröge-1/+1
Fixes #47115
2018-10-18Add slice::rchunks(), rchunks_mut(), rchunks_exact() and rchunks_exact_mut()Sebastian Dröge-0/+2
These work exactly like the normal chunks iterators but start creating chunks from the end of the slice. See #55177 for the tracking issue
2018-10-05Linkify types in docsHavvy (Ryan Scheel)-1/+1
2018-10-05Slice total example: Move closer to total defnHavvy (Ryan Scheel)-6/+9
2018-10-05Example of total ord of elements for sort_byHavvy (Ryan Scheel)-0/+6
2018-10-05Doc total order requirement of sort(_unstable)_byHavvy (Ryan Scheel)-0/+7
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.
2018-09-25Also rename ExactChunks iterator name to ChunksExactSebastian Dröge-1/+1
2018-09-24Rename slice::exact_chunks() to slice::chunks_exact()Sebastian Dröge-1/+1
See https://github.com/rust-lang/rust/issues/47115#issuecomment-403090815 and https://github.com/rust-lang/rust/issues/47115#issuecomment-424053547
2018-09-20std: Check for overflow in `str::repeat`Alex Crichton-1/+15
This commit fixes a buffer overflow issue in the standard library discovered by Scott McMurray where if a large number was passed to `str::repeat` it may cause and out of bounds write to the buffer of a `Vec`. This bug was accidentally introduced in #48657 when optimizing the `str::repeat` function. The bug affects stable Rust releases 1.26.0 to 1.29.0. We plan on backporting this fix to create a 1.29.1 release, and the 1.30.0 release onwards will include this fix. The fix in this commit is to introduce a deterministic panic in the case of capacity overflow. When repeating a slice where the resulting length is larger than the address space, there’s no way it can succeed anyway! The standard library and surrounding libraries were briefly checked to see if there were othere instances of preallocating a vector with a calculation that may overflow. No instances of this bug (out of bounds write due to a calculation overflow) were found at this time. Note that this commit is the first steps towards fixing this issue, we'll be making a formal post to the Rust security list once these commits have been merged.
2018-08-20Replace usages of ptr::offset with ptr::{add,sub}.Corey Farwell-4/+4
2018-06-02Rollup merge of #51147 - tmccombs:sliceindex, r=SimonSapinMark Simulacrum-1/+1
Stabilize SliceIndex trait. CC #35729 According to recommendations in https://github.com/rust-lang/rust/issues/35729#issuecomment-377784884
2018-06-01incorporate changes from code reviewEmerentius-11/+13
further reduce unsafe fn calls reduce right drift assert! sufficient capacity
2018-06-01optimize joining and concatenation for slicesEmerentius-11/+11
for both Vec<T> and String - eliminates the boolean first flag in fn join() for String only - eliminates repeated bounds checks in join(), concat() - adds fast paths for small string separators up to a len of 4 bytes
2018-06-01Stabilize SliceIndex trait.Thayne McCombs-1/+1
Fixes #35729 According to recommendations in https://github.com/rust-lang/rust/issues/35729#issuecomment-377784884
2018-05-21Stabilize feature from_refStjepan Glavina-2/+2
2018-05-17Switch to 1.26 bootstrap compilerMark Simulacrum-11/+2
2018-05-09move See also links to topMichael Lamparski-2/+2
2018-04-24Auto merge of #48999 - GuillaumeGomez:add-repeat-on-slice, r=Kimundibors-0/+71
Add repeat method on slice Fixes #48784.
2018-04-21Replace SliceExt with inherent [T] methods in libcoreSimon Sapin-1391/+5
2018-04-21Move non-allocating [u8] inherent methods to libcoreSimon Sapin-54/+4
Fixes #45803
2018-04-17stabilize `swap_with_slice` featuretinaun-7/+1
2018-04-17stabilize `slice_rsplit` featuretinaun-8/+3
2018-04-09Add trivial early return for sort_by_cached_keyvarkor-0/+1
2018-03-28Add repeat method on sliceGuillaume Gomez-0/+71
2018-03-26Remove mentions of unstable sort_by_cached key from stable documentationvarkor-8/+0
2018-03-18Check that the size optimisation is not redundantvarkor-5/+10
2018-03-18Clarify time complexityvarkor-2/+3
2018-03-17Improve and fix documentation for sort_by_cached_keyvarkor-8/+12
2018-03-17Fix use of unstable feature in testvarkor-2/+2
2018-03-16Add sort_by_cached_key methodvarkor-11/+50
2018-03-16Index enumeration by minimally sized typevarkor-12/+25
2018-03-16Cull the quadraticvarkor-0/+1
2018-03-16Update documentationvarkor-10/+11
2018-03-16Clarify behaviour of sort_unstable_by_key with respect to sort_by_keyvarkor-4/+11