summary refs log tree commit diff
path: root/src/libcollections/slice.rs
AgeCommit message (Collapse)AuthorLines
2015-02-18Round 4 test fixes and rebase conflictsAlex Crichton-2/+2
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-10/+10
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Stabilize std::borrowAaron Turon-9/+10
This commit stabilizes `std::borrow`, making the following modifications to catch up the API with language changes: * It renames `BorrowFrom` to `Borrow`, as was originally intended (but blocked for technical reasons), and reorders the parameters accordingly. * It moves the type parameter of `ToOwned` to an associated type. This is somewhat less flexible, in that each borrowed type must have a unique owned type, but leads to a significant simplification for `Cow`. Flexibility can be regained by using newtyped slices, which is advisable for other reasons anyway. * It removes the owned type parameter from `Cow`, making the type much less verbose. * Deprecates the `is_owned` and `is_borrowed` predicates in favor of direct matching. The above API changes are relatively minor; the basic functionality remains the same, and essentially the whole module is now marked `#[stable]`. [breaking-change]
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-10/+10
2015-02-16Auto merge of #22367 - Manishearth:rollup, r=steveklabnikbors-1/+0
(still testing locally)
2015-02-15Fix rollup (remove slicing_syntax)Manish Goregaokar-1/+0
2015-02-13more int and cloned cleanup in collectionsAlexis-2/+2
2015-02-11implement missing iterator traits for slice::WindowsDavid Creswick-0/+12
- DoubleEndedIterator - ExactSizeIterator - RandomAccessIterator
2015-02-06remove int_uint feature from libcollectionsAlexis-2/+2
2015-02-06Rollup merge of #21926 - mzabaluev:raw-lifetime, r=alexcrichtonManish Goregaokar-0/+1
New functions, `slice::from_raw_parts` and `slice::from_raw_parts_mut`, are added to implement the lifetime convention as agreed in rust-lang/rfcs#556. The functions `slice::from_raw_buf` and `slice::from_raw_mut_buf` are left deprecated for the time being. Holding back on changing the signature of `std::ffi::c_str_to_bytes` as consensus in rust-lang/rfcs#592 is building to replace it with a composition of other functions. Contribution to #21923.
2015-02-05remove int_uint feature from libcollectionsAlexis-20/+20
2015-02-05remove unecessary lifetimes from a bunch of collections codeAlexis-26/+26
2015-02-05misc collections code cleanupAlexis-300/+298
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-22/+22
2015-02-05Replace usage of slice::from_raw_buf with slice::from_raw_partsMikhail Zabaluev-0/+1
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-02`for x in xs.into_iter()` -> `for x in xs`Jorge Aparicio-1/+1
Also `for x in option.into_iter()` -> `if let Some(x) = option`
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-9/+9
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-6/+6
2015-02-02register snapshotsJorge Aparicio-6/+0
2015-01-30rollup merge of #21631: tbu-/isize_policeAlex Crichton-190/+190
Conflicts: src/libcoretest/iter.rs
2015-01-30fix falloutJorge Aparicio-1/+1
2015-01-30Remove all `i` suffixesTobias Bucher-190/+190
2015-01-30Remove FullRange from the prelude etc.Nick Cameron-0/+6
2015-01-29remove unused importsJorge Aparicio-1/+1
2015-01-29fix inference falloutJorge Aparicio-9/+9
2015-01-29convert remaining `range(a, b)` to `a..b`Jorge Aparicio-2/+2
2015-01-29`for x in range(a, b)` -> `for x in a..b`Jorge Aparicio-9/+9
sed -i 's/in range(\([^,]*\), *\([^()]*\))/in \1\.\.\2/g' **/*.rs
2015-01-29`range(a, b).foo()` -> `(a..b).foo()`Jorge Aparicio-17/+17
sed -i 's/ range(\([^,]*\), *\([^()]*\))\./ (\1\.\.\2)\./g' **/*.rs
2015-01-29Auto merge of #21680 - japaric:slice, r=alexcrichtonbors-31/+31
Replaces `slice_*` method calls with slicing syntax, and removes `as_slice()` calls that are redundant due to `Deref`.
2015-01-28Merge remote-tracking branch 'origin/master' into rollupManish Goregaokar-70/+88
Conflicts: src/libcollections/slice.rs src/libcore/nonzero.rs src/libcore/ops.rs
2015-01-27cleanup: s/`v.slice*()`/`&v[a..b]`/g + remove redundant `as_slice()` callsJorge Aparicio-31/+31
2015-01-26Correct a typo in a deprecation warningCarol Nichols-1/+1
2015-01-26Add examples to documentation of SliceExt methodsCarol Nichols-3/+104
2015-01-25Merge remote-tracking branch 'rust-lang/master'Brian Anderson-47/+53
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-23grandfathered -> rust1Brian Anderson-43/+43
2015-01-23Deprecated attributes don't take 'feature' names and are paired with ↵Brian Anderson-1/+2
stable/unstable Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
2015-01-23Set unstable feature names appropriatelyBrian Anderson-26/+26
* `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-22Rollup merge of #21484 - steveklabnik:connect_docs, r=alexcrichtonSteve Klabnik-2/+21
2015-01-21Remove 'since' from unstable attributesBrian Anderson-26/+26
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-70/+81
2015-01-21add doc examples for connect/concatSteve Klabnik-2/+21
2015-01-21rollup merge of #21258: aturon/stab-3-indexAlex Crichton-45/+19
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 #21457: alexcrichton/issue-21436Alex Crichton-6/+6
Conflicts: src/liballoc/boxed.rs src/librustc/middle/traits/error_reporting.rs src/libstd/sync/mpsc/mod.rs
2015-01-21rollup merge of #21053: apasel422/exactAlex Crichton-0/+7
2015-01-21Fallout from stabilization.Aaron Turon-1/+1
2015-01-21Deprecate slicing methods in favor of notationAaron Turon-44/+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-20std: Rename Show/String to Debug/DisplayAlex Crichton-6/+6
This commit is an implementation of [RFC 565][rfc] which is a stabilization of the `std::fmt` module and the implementations of various formatting traits. Specifically, the following changes were performed: [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0565-show-string-guidelines.md * The `Show` trait is now deprecated, it was renamed to `Debug` * The `String` trait is now deprecated, it was renamed to `Display` * Many `Debug` and `Display` implementations were audited in accordance with the RFC and audited implementations now have the `#[stable]` attribute * Integers and floats no longer print a suffix * Smart pointers no longer print details that they are a smart pointer * Paths with `Debug` are now quoted and escape characters * The `unwrap` methods on `Result` now require `Display` instead of `Debug` * The `Error` trait no longer has a `detail` method and now requires that `Display` must be implemented. With the loss of `String`, this has moved into libcore. * `impl<E: Error> FromError<E> for Box<Error>` now exists * `derive(Show)` has been renamed to `derive(Debug)`. This is not currently warned about due to warnings being emitted on stage1+ While backwards compatibility is attempted to be maintained with a blanket implementation of `Display` for the old `String` trait (and the same for `Show`/`Debug`) this is still a breaking change due to primitives no longer implementing `String` as well as modifications such as `unwrap` and the `Error` trait. Most code is fairly straightforward to update with a rename or tweaks of method calls. [breaking-change] Closes #21436
2015-01-20implement `ExactSizeIterator` for `slice::{Chunks,ChunksMut}`Andrew Paseltiner-0/+7
2015-01-17Remove unnecessary explicit conversions to *const Twe-1/+1
2015-01-12cleanup: `&foo[0..a]` -> `&foo[..a]`Jorge Aparicio-6/+6