summary refs log tree commit diff
path: root/src/libcollectionstest
AgeCommit message (Collapse)AuthorLines
2015-06-17More test fixes and fallout of stability changesAlex Crichton-1/+1
2015-06-17Fallout in tests and docs from feature renamingsAlex Crichton-12/+44
2015-06-11Auto merge of #26190 - Veedrac:no-iter, r=alexcrichtonbors-6/+6
Pull request for #26188.
2015-06-11Auto merge of #26122 - bluss:borrow-box, r=alexcrichtonbors-0/+29
Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>
2015-06-11Auto merge of #25839 - bluss:str-split-at-impl, r=alexcrichtonbors-0/+20
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str). Also a minor cleanup in the collections::str module. Remove redundant slicing of self.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-6/+6
2015-06-10Add str::split_atUlrik Sverdrup-0/+20
Implement RFC rust-lang/rfcs#1123 Add str method str::split_at(mid: usize) -> (&str, &str).
2015-06-09Auto merge of #26039 - SimonSapin:case-mapping, r=alexcrichtonbors-0/+39
* Add “complex” mappings to `char::to_lowercase` and `char::to_uppercase`, making them yield sometimes more than on `char`: #25800. `str::to_lowercase` and `str::to_uppercase` are affected as well. * Add `char::to_titlecase`, since it’s the same algorithm (just different data). However this does **not** add `str::to_titlecase`, as that would require UAX#29 Unicode Text Segmentation which we decided not to include in of `std`: https://github.com/rust-lang/rfcs/pull/1054 I made `char::to_titlecase` immediately `#[stable]`, since it’s so similar to `char::to_uppercase` that’s already stable. Let me know if it should be `#[unstable]` for a while. * Add a special case for upper-case Sigma in word-final position in `str::to_lowercase`: #26035. This is the only language-independent conditional mapping currently in `SpecialCasing.txt`. * Stabilize `str::to_lowercase` and `str::to_uppercase`. The `&self -> String` on `str` signature seems straightforward enough, and the only relevant issue I’ve found is #24536 about naming. But `char` already has stable methods with the same name, and deprecating them for a rename doesn’t seem worth it. r? @alexcrichton
2015-06-09Implement Borrow<T> and BorrowMut<T> for Box<T: ?Sized>Ulrik Sverdrup-0/+29
2015-06-09Move collectionstest::char into coretest::charSimon Sapin-43/+0
2015-06-08Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichtonbors-64/+64
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.) r? @alexcrichton CC @nagisa
2015-06-08Address a review comment and fix a bootstrapping issueSimon Sapin-1/+27
2015-06-08Replace usage of String::from_str with String:fromSimon Sapin-64/+64
2015-06-08Implement RFC 839Johannes Oertel-0/+213
Closes #25976.
2015-06-06Correctly map upper-case Sigma to lower-case in word-final position. Fix #26035.Simon Sapin-0/+13
2015-06-06Add char::to_titlecaseSimon Sapin-0/+10
But not str::to_titlecase which would require UAX#29 Unicode Text Segmentation which we decided not to include in of `std`: https://github.com/rust-lang/rfcs/pull/1054
2015-06-06Add complex (but unconditional) Unicode case mapping. Fix #25800Simon Sapin-0/+33
As a result, the iterator returned by `char::to_uppercase` sometimes yields two or three `char`s instead of just one.
2015-05-29add const_fn featuresNiko Matsakis-0/+1
2015-05-27Use `const fn` to abstract away the contents of UnsafeCell & friends.Eduard Burtescu-2/+2
2015-05-10Implement `append` and `split_off` for BitSet (RFC 509)Johannes Oertel-0/+62
2015-05-07Auto merge of #24890 - jooert:bitvec-append-split_off, r=alexcrichtonbors-0/+136
cc #19986 r? @Gankro
2015-05-06Implement append and split_off for BitVec (RFC 509)Johannes Oertel-0/+136
2015-05-04Implement retain for vec_dequeSteven Allen-0/+10
2015-05-04Auto merge of #25047 - sinkuu:vec_intoiter_override, r=alexcrichtonbors-0/+5
Override methods `count`, `last`, and `nth` in vec::IntoIter. #24214
2015-05-02Override Iterator::count method in vec::IntoItersinkuu-0/+5
2015-05-01collections: Implement String::drain(range) according to RFC 574Ulrik Sverdrup-0/+17
`.drain(range)` is unstable and under feature(collections_drain). This adds a safe way to remove any range of a String as efficiently as possible. As noted in the code, this drain iterator has none of the memory safety issues of the vector version. RFC tracking issue is #23055
2015-04-28Register new snapshotsTamir Duberstein-2/+0
2015-04-28collections: Implement vec::drain(range) according to RFC 574Ulrik Sverdrup-3/+34
Old `.drain()` on vec is performed using `.drain(..)` now. `.drain(range)` is unstable and under feature(collections_drain) [breaking-change]
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-3/+2
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-19collections: Move optimized String::from_str to String::fromErick Tryzelaar-0/+27
This implementation is currently about 3-4 times faster than using the `.to_string()` based approach.
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-4/+10
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-14rollup merge of #24310: alexcrichton/stabilize-utf8-errorAlex Crichton-2/+1
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
2015-04-14More test fixesAlex Crichton-9/+8
2015-04-14test: Fixup many library unit testsAlex Crichton-21/+18
2015-04-10std: Stabilize the Utf8Error typeAlex Crichton-2/+1
The meaning of each variant of this enum was somewhat ambiguous and it's uncler that we wouldn't even want to add more enumeration values in the future. As a result this error has been altered to instead become an opaque structure. Learning about the "first invalid byte index" is still an unstable feature, but the type itself is now stable.
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-1/+0
Previously it could not be implemented for types outside `libcore/iter.rs` due to coherence issues.
2015-04-08Make `sum` and `product` inherent methods on `Iterator`Tobias Bucher-1/+0
In addition to being nicer, this also allows you to use `sum` and `product` for iterators yielding custom types aside from the standard integers. Due to removing the `AdditiveIterator` and `MultiplicativeIterator` trait, this is a breaking change. [breaking-change]
2015-04-07Auto merge of #23952 - Kimundi:more_string_pattern, r=alexcrichtonbors-1/+500
This adds the missing methods and turns `str::pattern` in a user facing module, as per RFC. This also contains some big internal refactorings: - string iterator pairs are implemented with a central macro to reduce redundancy - Moved all tests from `coretest::str` into `collectionstest::str` and left a note to prevent the two sets of tests drifting apart further. See https://github.com/rust-lang/rust/issues/22477
2015-04-05Added smoke tests for new methods.Marvin Löbel-12/+137
Fixed bug in existing StrSearcher impl
2015-04-05Moved coretest::str tests into collectiontest::strMarvin Löbel-1/+375
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-41/+41
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise). This is a minor [breaking-change] to an unstable interface. r? @aturon
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-2/+2
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01rollup merge of #23945: pnkfelix/gate-u-negateAlex Crichton-2/+2
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
2015-04-02Test fixes and rebase conflicts, round 2Alex Crichton-2/+2
Conflicts: src/libcore/num/mod.rs
2015-04-01std: Changing the meaning of the count to splitnAlex Crichton-19/+20
This commit is an implementation of [RFC 979][rfc] which changes the meaning of the count parameter to the `splitn` function on strings and slices. The parameter now means the number of items that are returned from the iterator, not the number of splits that are made. [rfc]: https://github.com/rust-lang/rfcs/pull/979 Closes #23911 [breaking-change]
2015-04-01Fallout in public-facing and semi-public-facing libsNiko Matsakis-2/+2
2015-03-31rollup merge of #23288: alexcrichton/issue-19470Alex Crichton-18/+18
This is a deprecated attribute that is slated for removal, and it also affects all implementors of the trait. This commit removes the attribute and fixes up implementors accordingly. The primary implementation which was lost was the ability to compare `&[T]` and `Vec<T>` (in that order). This change also modifies the `assert_eq!` macro to not consider both directions of equality, only the one given in the left/right forms to the macro. This modification is motivated due to the fact that `&[T] == Vec<T>` no longer compiles, causing hundreds of errors in unit tests in the standard library (and likely throughout the community as well). Closes #19470 [breaking-change]
2015-03-31rollup merge of #23873: alexcrichton/remove-deprecatedAlex Crichton-60/+57
Conflicts: src/libcollectionstest/fmt.rs src/libcollectionstest/lib.rs src/libcollectionstest/str.rs src/libcore/error.rs src/libstd/fs.rs src/libstd/io/cursor.rs src/libstd/os.rs src/libstd/process.rs src/libtest/lib.rs src/test/run-pass-fulldeps/compiler-calls.rs
2015-03-31Test fixes and rebase conflicts, round 1Alex Crichton-0/+1
2015-03-31std: Clean out #[deprecated] APIsAlex Crichton-73/+58
This commit cleans out a large amount of deprecated APIs from the standard library and some of the facade crates as well, updating all users in the compiler and in tests as it goes along.