about summary refs log tree commit diff
path: root/src/liballoc/slice.rs
AgeCommit message (Collapse)AuthorLines
2017-11-29Update bootstrap compilerAlex Crichton-4/+1
Also remove a number of `stage0` annotations and such
2017-11-29Rollup merge of #46219 - rust-lang:frewsxcv-issue-45636, r=GuillaumeGomezkennytm-13/+106
Improve documentation for slice swap/copy/clone operations. Fixes #45636. - Demonstrate how to use these operations with slices of differing lengths - Demonstrate how to swap/copy/clone sub-slices of a slice using `split_at_mut`
2017-11-29Rollup merge of #46077 - LukasKalbertodt:stabilize-ascii-ctype, r=alexcrichtonkennytm-114/+0
Stabilize some `ascii_ctype` methods As discussed in #39658, this PR stabilizes those methods for `u8` and `char`. All inherent `ascii_ctype` for `[u8]` and `str` are removed as we prefer the more explicit version `s.chars().all(|c| c.is_ascii_())`. This PR doesn't modify the `AsciiExt` trait. There, the `ascii_ctype` methods are still unstable. It is planned to remove those in the future (I think). I had to modify some code in `ascii.rs` to properly implement `AsciiExt` for all types. Fixes #39658.
2017-11-24Improve documentation for slice swap/copy/clone operations.Corey Farwell-13/+106
Fixes #45636. - Demonstrate how to use these operations with slices of differing lengths - Demonstrate how to swap/copy/clone sub-slices of a slice using `split_at_mut`
2017-11-22Rename param in `[T]::swap_with_slice` from `src` to `other`.Corey Farwell-9/+9
The idea of ‘source’ and ‘destination’ aren’t very applicable for this operation since both slices can both be considered sources and destinations.
2017-11-18Remove inherent `ascii_ctype` methods from `str` and `[u8]`Lukas Kalbertodt-114/+0
This has been discussed in #39658. It's a bit ambiguous how those methods work for a sequence of ascii values. We prefer users writing `s.iter().all(|b| b.is_ascii_...())` explicitly. The AsciiExt methods still exist and are implemented for `str` and `[u8]`. We will deprecated or remove those later.
2017-11-03Mark several ascii methods as unstable againLukas Kalbertodt-10/+10
We don't want to stabilize them now already. The goal of this set of commits is just to add inherent methods to the four types. Stabilizing all of those methods can be done later.
2017-11-03Copy `AsciiExt` methods to `str` directlyLukas Kalbertodt-1/+1
This is done in order to deprecate AsciiExt eventually. Note that this commit contains a bunch of `cfg(stage0)` statements. This is due to a new compiler feature this commit depends on: the `slice_u8` lang item. Once this lang item is available in the stage0 compiler, all those cfg flags (and more) can be removed.
2017-11-03Copy `AsciiExt` methods to `[u8]` directlyLukas Kalbertodt-0/+209
This is done in order to deprecate AsciiExt eventually. Note that this commit contains a bunch of `cfg(stage0)` statements. This is due to a new compiler feature I am using: the `slice_u8` lang item. Once this lang item is available in the stage0 compiler, all those cfg flags (and more) can be removed.
2017-11-01De-stabilize core::slice::{from_ref, from_ref_mut}.whitequark-1/+1
2017-10-23Bring back slice::ref_slice as slice::from_ref.whitequark-0/+2
These functions were deprecated and removed in 1.5, but such simple functionality shouldn't require using unsafe code, and it isn't cluttering libstd too much.
2017-09-04Make slice::split_at_mut example demonstrate mutabilityNiels Egberts-20/+25
Moved the examples from split_at_mut to split_at so the example at split_at_mut can just demonstrate mutability.
2017-08-26Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnikCorey Farwell-9/+9
Fix inconsistent doc headings This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574. r? @steveklabnik
2017-08-24Fix inconsistent doc headingslukaramu-9/+9
This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.
2017-08-21Add [T]::swap_with_sliceScott McMurray-0/+25
The safe version of a method from ptr, like [T]::copy_from_slice
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-07-21Clarify that sort_unstable is deterministicStjepan Glavina-15/+18
2017-07-02Auto merge of #43010 - stjepang:stabilize-sort-unstable, r=alexcrichtonbors-12/+15
Stabilize feature sort_unstable Closes #40585
2017-07-02Stabilize feature sort_unstableStjepan Glavina-12/+15
2017-06-24Improve sort tests and benchmarksStjepan Glavina-2/+2
2017-06-13Merge crate `collections` into `alloc`Murarth-0/+1943