about summary refs log tree commit diff
path: root/src/libcore/slice.rs
AgeCommit message (Collapse)AuthorLines
2015-02-18Fallout: Port slice to use `PhantomData` instead of `ContravariantLifetime`Niko Matsakis-7/+7
2015-02-17Register new snapshotsAlex Crichton-22/+0
2015-02-17std: Stabilize the IntoIterator traitAlex Crichton-0/+2
Now that the necessary associated types exist for the `IntoIterator` trait this commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17Rollup merge of #22313 - japaric:iter, r=aturonManish Goregaokar-0/+24
`IntoIterator` now has an extra associated item: ``` rust trait IntoIterator { type Item; type IntoIter: Iterator<Self=Self::Item>; } ``` This lets you bind the iterator \"`Item`\" directly when writing generic functions: ``` rust // hypothetical change, not included in this PR impl Extend<T> for Vec<T> { // you can now write fn extend<I>(&mut self, it: I) where I: IntoIterator<Item=T> { .. } // instead of fn extend<I: IntoIterator>(&mut self, it: I) where I::IntoIter: Iterator<Item=T> { .. } } ``` The downside is that now you have to write an extra associated type in your `IntoIterator` implementations: ``` diff impl<T> IntoIterator for Vec<T> { + type Item = T; type IntoIter = IntoIter<T>; fn into_iter(self) -> IntoIter<T> { .. } } ``` Because this breaks all downstream implementations of `IntoIterator`, this is a [breaking-change] --- r? @aturon
2015-02-14core::slice: uint -> usize, int -> isizeBrian Anderson-117/+117
2015-02-13add an associated `Item` type to `IntoIterator`Jorge Aparicio-0/+24
2015-02-11More test fixes and rebase conflictsAlex Crichton-1/+0
2015-02-11implement missing iterator traits for slice::WindowsDavid Creswick-2/+36
- DoubleEndedIterator - ExactSizeIterator - RandomAccessIterator
2015-02-09std: Rename IntoIterator::Iter to IntoIterAlex Crichton-2/+2
This is in preparation for stabilization of the `IntoIterator` trait. All implementations and references to `Iter` need to be renamed to `IntoIter`. [breaking-change]
2015-02-06make `IndexMut` a super trait over `Index`Jorge Aparicio-10/+0
closes #21630
2015-02-05Replace usage of slice::from_raw_buf with slice::from_raw_partsMikhail Zabaluev-4/+52
New functions, slice::from_raw_parts and slice::from_raw_parts_mut, are added to implement the lifetime convention as agreed in RFC PR #556. The functions slice::from_raw_buf and slice::from_raw_mut_buf are left deprecated for the time being.
2015-02-02register snapshotsJorge Aparicio-13/+0
2015-01-30remove Copy impls from iteratorsJorge Aparicio-4/+1
2015-01-30core: add the `IntoIterator` traitJorge Aparicio-0/+16
2015-01-30Rename FullRange to RangeFullNick Cameron-14/+28
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-1/+1
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-4/+4
Conflicts: src/libcore/cmp.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/result.rs src/libcore/str/mod.rs src/librustc/lint/builtin.rs src/librustc/lint/context.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/poison.rs
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-54/+27
Conflicts: mk/tests.mk src/liballoc/arc.rs src/liballoc/boxed.rs src/liballoc/rc.rs src/libcollections/bit.rs src/libcollections/btree/map.rs src/libcollections/btree/set.rs src/libcollections/dlist.rs src/libcollections/ring_buf.rs src/libcollections/slice.rs src/libcollections/str.rs src/libcollections/string.rs src/libcollections/vec.rs src/libcollections/vec_map.rs src/libcore/any.rs src/libcore/array.rs src/libcore/borrow.rs src/libcore/error.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/ops.rs src/libcore/result.rs src/libcore/slice.rs src/libcore/str/mod.rs src/libregex/lib.rs src/libregex/re.rs src/librustc/lint/builtin.rs src/libstd/collections/hash/map.rs src/libstd/collections/hash/set.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/mutex.rs src/libstd/sync/poison.rs src/libstd/sync/rwlock.rs src/libsyntax/feature_gate.rs src/libsyntax/test.rs
2015-01-25Moving away from deprecated i/u suffixes in libcoreAlfie John-4/+4
2015-01-23grandfathered -> rust1Brian Anderson-34/+34
2015-01-23Set unstable feature names appropriatelyBrian Anderson-32/+32
* `core` - for the core crate * `hash` - hashing * `io` - io * `path` - path * `alloc` - alloc crate * `rand` - rand crate * `collections` - collections crate * `std_misc` - other parts of std * `test` - test crate * `rustc_private` - everything else
2015-01-21Remove 'since' from unstable attributesBrian Anderson-32/+32
2015-01-21Tie stability attributes to feature gatesBrian Anderson-1/+0
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-66/+69
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.