about summary refs log tree commit diff
path: root/src/libcore/slice.rs
AgeCommit message (Collapse)AuthorLines
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-50/+18
Conflicts: src/libcore/ops.rs src/librustc_typeck/astconv.rs src/libstd/io/mem.rs src/libsyntax/parse/lexer/mod.rs
2015-01-21rollup merge of #21396: japaric/no-parens-in-rangeAlex Crichton-4/+4
Conflicts: src/libsyntax/parse/lexer/comments.rs
2015-01-21rollup merge of #21053: apasel422/exactAlex Crichton-0/+5
2015-01-21Deprecate slicing methods in favor of notationAaron Turon-50/+18
This commit deprecates `slice`, `slice_from`, `slice_to` and their mutable variants in favor of slice notation. The `as_slice` methods are left intact, for now. [breaking-change]
2015-01-20implement `ExactSizeIterator` for `slice::{Chunks,ChunksMut}`Andrew Paseltiner-0/+5
2015-01-19remove unnecessary parentheses from range notationJorge Aparicio-4/+4
2015-01-17Remove unnecessary explicit conversions to *const Twe-2/+2
2015-01-12cleanup: `&foo[0..a]` -> `&foo[..a]`Jorge Aparicio-6/+6
2015-01-08Improvements to feature stagingBrian Anderson-26/+26
This gets rid of the 'experimental' level, removes the non-staged_api case (i.e. stability levels for out-of-tree crates), and lets the staged_api attributes use 'unstable' and 'deprecated' lints. This makes the transition period to the full feature staging design a bit nicer.
2015-01-07use slicing sugarJorge Aparicio-12/+12
2015-01-06Test fixes and rebase conflictsAlex Crichton-5/+5
2015-01-06rollup merge of #20656: japaric/at-cleanAlex Crichton-2/+2
2015-01-06rollup merge of #20607: nrc/kindsAlex Crichton-2/+2
Conflicts: src/libcore/array.rs src/libcore/cell.rs src/libcore/prelude.rs src/libstd/path/posix.rs src/libstd/prelude/v1.rs src/test/compile-fail/dst-sized-trait-param.rs
2015-01-07markers -> markerNick Cameron-8/+8
2015-01-07falloutNick Cameron-55/+49
2015-01-07Replace full slice notation with index callsNick Cameron-16/+30
2015-01-07Impls using the new scheme for slicingNick Cameron-72/+128
2015-01-07Change `std::kinds` to `std::markers`; flatten `std::kinds::marker`Nick Cameron-8/+8
[breaking-change]
2015-01-06cleanup: use short AT notation (`Ty::Item` instead of `<Ty as Trait>::Item`)Jorge Aparicio-2/+2
2015-01-05Merge remote-tracking branch 'nrc/sized-2' into rollupAlex Crichton-2/+2
Conflicts: src/liballoc/boxed.rs src/libcollections/btree/map.rs src/libcollections/slice.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/libstd/collections/hash/map.rs src/libsyntax/parse/obsolete.rs src/test/compile-fail/unboxed-closure-sugar-default.rs src/test/compile-fail/unboxed-closure-sugar-equiv.rs src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs src/test/compile-fail/unboxed-closure-sugar-region.rs src/test/compile-fail/unsized3.rs src/test/run-pass/associated-types-conditional-dispatch.rs
2015-01-05rollup merge of #20556: japaric/no-for-sizedAlex Crichton-5/+4
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/libcore/borrow.rs src/libcore/cmp.rs src/libcore/ops.rs src/libstd/c_str.rs src/test/compile-fail/issue-19009.rs
2015-01-05rollup merge of #20560: aturon/stab-2-iter-ops-sliceAlex Crichton-19/+24
Conflicts: src/libcollections/slice.rs src/libcore/iter.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/rwlock.rs
2015-01-06FalloutNick Cameron-2/+2
2015-01-05Stabilization of impls and fallout from stabilizationAaron Turon-15/+16
2015-01-05register snapshotJorge Aparicio-22/+0
2015-01-05Final alpha stabilization of std::sliceAaron Turon-4/+8
Marks as `#[stable]`: * Various iterator structs for stable methods, e.g. `Chunks` and `Windows`. * The `SliceExt` trait itself.
2015-01-05remove unused `Sized` importsJorge Aparicio-1/+0
2015-01-05sed -i -s 's/ for Sized?//g' **/*.rsJorge Aparicio-4/+4
2015-01-03Remove deprecated functionalityAlex Crichton-77/+1
This removes a large array of deprecated functionality, regardless of how recently it was deprecated. The purpose of this commit is to clean out the standard libraries and compiler for the upcoming alpha release. Some notable compiler changes were to enable warnings for all now-deprecated command line arguments (previously the deprecated versions were silently accepted) as well as removing deriving(Zero) entirely (the trait was removed). The distribution no longer contains the libtime or libregex_macros crates. Both of these have been deprecated for some time and are available externally.
2015-01-03sed -i -s 's/#\[deriving(/#\[derive(/g' **/*.rsJorge Aparicio-3/+3
2015-01-03sed -i -s 's/\bmod}/self}/g' **/*.rsJorge Aparicio-1/+1
2015-01-03core: use assoc types in `Index[Mut]`Jorge Aparicio-0/+26
2015-01-03core: use assoc types in Iterator et alJorge Aparicio-22/+38
2015-01-02merge `*SliceExt` traits, use assoc types in `SliceExt`, `Raw[Mut]Ptr`Jorge Aparicio-174/+145
2014-12-30rollup merge of #20061: aturon/stab-2-vec-sliceAlex Crichton-159/+171
Conflicts: src/libcollections/slice.rs src/libcollections/vec.rs src/libstd/sys/windows/os.rs
2014-12-30Fallout from stabilizationAaron Turon-2/+4
2014-12-30Stabilize cmpAaron Turon-4/+4
This patch marks `PartialEq`, `Eq`, `PartialOrd`, and `Ord` as `#[stable]`, as well as the majorify of manual implementaitons of these traits. The traits match the [reform RFC](https://github.com/rust-lang/rfcs/pull/439). Along the way, two changes are made: * The recently-added type parameters for `Ord` and `Eq` are removed. These were mistakenly added while adding them to `PartialOrd` and `PartialEq`, but they don't make sense given the laws that are required for (and use cases for) `Ord` and `Eq`. * More explicit laws are added for `PartialEq` and `PartialOrd`, connecting them to their associated mathematical concepts. In the future, many of the impls should be generalized; see since generalizing later is not a breaking change. [breaking-change]
2014-12-30Second pass stabilization: sliceAaron Turon-159/+169
This commit takes a second pass through the `slice` module to stabilize its API. The changes are as follows: **Stable**: * `as_mut_slice` * `as_ptr`, `as_mut_ptr` * `binary_search_by` (was: `binary_search`) * `binary_search` (was: `binary_search_elem`) * `chunks`, `chunks_mut` * `contains` * `ends_with` * `first`, `first_mut` (was: `head`) * `get_unchecked`, `get_unchecked_mut` (was: `unsafe_get`) * `get` * `is_empty` * `iter`, `iter_mut` * `len` * `reverse` * `sort_by` * `sort` * `split_at`, `split_at_mut` * `split_mut`, `splitn_mut`, `rsplitn_mut` * `split`, `splitn`, `rsplitn` * `starts_with` * `swap` * `to_vec` * `windows` **Deprecated**: * `head`, `head_mut` (renamed as above) * `unsafe_get`, `unsafe_mut` (renamed as above) * `binary_search_elem` (renamed as above) * `partitioned`, deprecated in favor of a new, more general iterator consumer called `partition`. * `BinarySearchResult`, deprecated in favor of `Result<uint, uint>` [breaking-change]
2014-12-29rollup merge of #20160: nick29581/ranges2Alex Crichton-11/+12
The first six commits are from an earlier PR (#19858) and have already been reviewed. This PR makes an awful hack in the compiler to accommodate slices both natively and in the index a range form. After a snapshot we can hopefully add the new Index impls and then we can remove these awful hacks. r? @nikomatsakis (or anyone who knows the compiler, really)
2014-12-30Fallout from mut slicesNick Cameron-9/+10
2014-12-30Remove ExprSlice by hacking the compilerNick Cameron-2/+2
[breaking-change] The `mut` in slices is now redundant. Mutability is 'inferred' from position. This means that if mutability is only obvious from the type, you will need to use explicit calls to the slicing methods.
2014-12-29std: Second pass stabilization for `ptr`Alex Crichton-2/+2
This commit performs a second pass for stabilization over the `std::ptr` module. The specific actions taken were: * The `RawPtr` trait was renamed to `PtrExt` * The `RawMutPtr` trait was renamed to `MutPtrExt` * The module name `ptr` is now stable. * These functions were all marked `#[stable]` with no modification: * `null` * `null_mut` * `swap` * `replace` * `read` * `write` * `PtrExt::is_null` * `PtrExt::offset` * These functions remain unstable: * `as_ref`, `as_mut` - the return value of an `Option` is not fully expressive as null isn't the only bad value, and it's unclear whether we want to commit to these functions at this time. The reference/lifetime semantics as written are also problematic in how they encourage arbitrary lifetimes. * `zero_memory` - This function is currently not used at all in the distribution, and in general it plays a broader role in the "working with unsafe pointers" story. This story is not yet fully developed, so at this time the function remains unstable for now. * `read_and_zero` - This function remains unstable for largely the same reasons as `zero_memory`. * These functions are now all deprecated: * `PtrExt::null` - call `ptr::null` or `ptr::null_mut` instead. * `PtrExt::to_uint` - use an `as` expression instead. * `PtrExt::is_not_null` - use `!p.is_null()` instead.
2014-12-22Added missing renames:Florian Wilkens-1/+1
libcollections: AbsEntries -> AbsIter, Entries -> Iter, MoveEntries -> IntoIter, MutEntries -> IterMut DifferenceItems -> Difference, SymDifferenceItems -> SymmetricDifference, IntersectionItems -> Intersection, UnionItems -> Union libstd/hash/{table, map}: Entries -> Iter, MoveItems -> IntoIter, MutEntries -> IterMut Also a [breaking-change].
2014-12-22Renaming of the Iter types as in RFC #344Florian Wilkens-25/+25
libcore: slice::Items -> slice::Iter, slice::MutItems -> slice::IterMut libcollections: *::Items -> *::Iter, *::MoveItems -> *::IntoIter, *::MutItems -> *::IterMut This is of course a [breaking-change].
2014-12-20Stabilize cloneAaron Turon-2/+2
This patch marks `clone` stable, as well as the `Clone` trait, but leaves `clone_from` unstable. The latter will be decided by the beta. The patch also marks most manual implementations of `Clone` as stable, except where the APIs are otherwise deprecated or where there is uncertainty about providing `Clone`.
2014-12-19libcore: use `#[deriving(Copy)]`Jorge Aparicio-3/+1
2014-12-18librustc: Always parse `macro!()`/`macro![]` as expressions if notPatrick Walton-9/+9
followed by a semicolon. This allows code like `vec![1i, 2, 3].len();` to work. This breaks code that uses macros as statements without putting semicolons after them, such as: fn main() { ... assert!(a == b) assert!(c == d) println(...); } It also breaks code that uses macros as items without semicolons: local_data_key!(foo) fn main() { println("hello world") } Add semicolons to fix this code. Those two examples can be fixed as follows: fn main() { ... assert!(a == b); assert!(c == d); println(...); } local_data_key!(foo); fn main() { println("hello world") } RFC #378. Closes #18635. [breaking-change]
2014-12-17rollup merge of #19902: alexcrichton/second-pass-memAlex Crichton-1/+2
This commit stabilizes the `mem` and `default` modules of std.
2014-12-17rollup merge of #19832: japaric/no-nocopyAlex Crichton-5/+2
r? @aturon / @alexcrichton
2014-12-17rollup merge of #19827: japaric/clone-ucAlex Crichton-0/+11
closes #12677 (cc @Valloric) cc #15294 r? @aturon / @alexcrichton (Because of #19358 I had to move the struct bounds from the `where` clause into the parameter list)