summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2015-05-13Update BitSet docs to correct typesPaul Quint-3/+3
Update BitSet docs to correct type in one more spot removed accidental file
2015-05-10collections: change bounds of SliceConcatExt implementations to use Borrow ↵Sean McArthur-12/+10
instead of AsRef Conflicts: src/libcollections/slice.rs src/libcollections/str.rs
2015-05-10collections: impl AsRef<[u8]> for StringSean McArthur-0/+8
2015-05-10std: Mark `mem::forget` as a safe functionAlex Crichton-2/+2
This commit is an implementation of [RFC 1066][rfc] where the conclusion was that leaking a value is a safe operation in Rust code, so updating the signature of this function follows suit. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1066-safe-mem-forget.md Closes #25186
2015-05-10Merge pull request #25276 from steveklabnik/third_doc_backportSteve Klabnik-1/+1
Third doc backport
2015-05-10doc: it is 'index', not 'i'Tshepang Lekhonkhobe-1/+1
2015-05-10collections: Improve example for as_string and as_vecUlrik Sverdrup-4/+21
2015-05-10Utilize `while let` instead of `loop` with `break` in doc-commentCorey Farwell-5/+1
2015-05-07std: Remove addition on vectors for nowAlex Crichton-12/+1
Ideally this trait implementation would be unstable, requiring crates to opt-in if they would like the functionality, but that's not currently how stability works so the implementation needs to be removed entirely. This may come back at a future date, but for now the conservative option is to remove it. [breaking-change] Conflicts: src/libcollections/vec.rs
2015-05-07std: Remove index notation on slice iteratorsAlex Crichton-14/+16
These implementations were intended to be unstable, but currently the stability attributes cannot handle a stable trait with an unstable `impl` block. This commit also audits the rest of the standard library for explicitly-`#[unstable]` impl blocks. No others were removed but some annotations were changed to `#[stable]` as they're defacto stable anyway. One particularly interesting `impl` marked `#[stable]` as part of this commit is the `Add<&[T]>` impl for `Vec<T>`, which uses `push_all` and implicitly clones all elements of the vector provided. Closes #24791 Conflicts: src/libcoretest/slice.rs src/librustc_driver/lib.rs
2015-04-25Utilize if..let for get_mut doc-comment examplesCorey Farwell-14/+8
2015-04-25Update reference to old_io in fmt docsMatt Brubeck-1/+1
2015-04-25Whoops, please tidySteve Klabnik-9/+9
2015-04-25Add examples by @pnkfelix to fmt precisionSteve Klabnik-5/+62
Fixes #24656
2015-04-23Test fixes and rebase conflicts, round 1Alex Crichton-2/+1
Conflicts: src/test/run-pass/task-stderr.rs
2015-04-23std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-5/+4
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types. Conflicts: src/doc/trpl/traits.md src/libstd/sys/windows/fs2.rs
2015-04-23std: Remove deprecated/unstable num functionalityAlex Crichton-8/+0
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change] Conflicts: src/libstd/num/strconv.rs
2015-04-23std: Remove deprecated AsOsStr/Str/AsSlice traitsAlex Crichton-23/+2
Cleaning out more deprecated items Conflicts: src/libcore/result.rs
2015-04-23unstabilize Words structkwantam-0/+1
Words struct was stabilied by mistake. Unstabilize.
2015-04-23std: Add Default/IntoIterator/ToOwned to the preludeAlex Crichton-175/+133
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-14Fill in missing implementationTamir Duberstein-0/+3
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-1/+1
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14Positive case of `len()` -> `is_empty()`Tamir Duberstein-2/+2
`s/(?<!\{ self)(?<=\.)len\(\) == 0/is_empty()/g`
2015-04-14rollup merge of #24377: apasel422/docsAlex Crichton-26/+26
Conflicts: src/libstd/net/ip.rs src/libstd/sys/unix/fs.rs src/libstd/sys/unix/mod.rs src/libstd/sys/windows/mod.rs
2015-04-14rollup merge of #24310: alexcrichton/stabilize-utf8-errorAlex Crichton-10/+7
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-14test: Fixup many library unit testsAlex Crichton-2/+2
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-26/+26
2015-04-13Auto merge of #23849 - bcoopers:master, r=pnkfelixbors-6/+18
Right now, if the user requests to increase the vector size via reserve() or push_back() and the request brings the attempted memory above usize::MAX, we panic. With this change there is only a panic if the minimum requested memory that could meet the requirement is above usize::MAX- otherwise it simply requests its largest capacity possible, usize::MAX.
2015-04-12The panic! macro can't be called with a variable declaredbcoopers-3/+3
with "let" when building on stage0. So change the error message to a static const.
2015-04-11Rollup merge of #24304 - ihrwein:fix-some-typos, r=alexcrichtonManish Goregaokar-2/+2
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
2015-04-11Rollup merge of #24279 - libfud:vec_insertion_docs, r=steveklabnikManish Goregaokar-2/+1
...to be less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording. r? @steveklabnik
2015-04-10std: Stabilize the Utf8Error typeAlex Crichton-10/+7
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-10Fix some typosTibor Benke-2/+2
Signed-off-by: Tibor Benke <ihrwein@gmail.com>
2015-04-10Changed the wording of the documentation for the insert method for Vec to be ↵Dominick Allen-2/+1
less confusing. Since 0 is the smallest number possible for usize, it doesn't make sense to mention it if it's already included, and it should be more clear that the length of the vector is a valid index with the new wording.
2015-04-09Fix `borrow` docsAndrew Paseltiner-9/+9
2015-04-08Auto merge of #23293 - tbu-:pr_additive_multiplicative, r=alexcrichtonbors-4/+2
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-4/+2
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-97/+393
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-05Refactored core::str::pattern to become a user-facing module and hide awayMarvin Löbel-3/+4
CharEq.
2015-04-05Format all str docs to 80 char line breaksMarvin Löbel-109/+174
2015-04-05Implemented remaining string pattern iterators.Marvin Löbel-45/+275
- Added missing reverse versions of methods - Added [r]matches() - Generated the string pattern iterators with a macro - Added where bounds to the methods returning reverse iterators for better error messages.
2015-04-04Rollup merge of #24012 - tsion:patch-1, r=steveklabnikManish Goregaokar-1/+1
This was brought up in IRC by a confused reader. r? steveklabnik
2015-04-04Rollup merge of #23995 - aturon:cow-as-ref, r=huonwManish Goregaokar-1/+1
The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed.
2015-04-03Auto merge of #23972 - gkoz:partial_eq_str_string, r=alexcrichtonbors-10/+12
Right now comparing a `&String` (or a `&Cow`) to a `&str` requires redundant borrowing of the latter. Implementing `PartialEq<str>` tries to avoid this limitation. ```rust struct Foo (String); fn main () { let s = Foo("foo".to_string()); match s { Foo(ref x) if x == &"foo" => println!("foo!"), // avoid this -----^ _ => {} } } ``` I was hoping that #23521 would solve this but it didn't work out.
2015-04-03Remove unnecessary `Vec<_>` annotation from docsScott Olson-1/+1
This was brought up in IRC by a confused reader.
2015-04-02Adjust `AsRef` impl for `Cow`Aaron Turon-1/+1
The existing impl had the too-strong requirement of `Clone`, when only `ToOwned` was needed.
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-18/+18
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-02Implement PartialEq<str> for String and CowGleb Kozyrev-0/+2
2015-04-02Change PartialEq impls in collections::string to slice notationGleb Kozyrev-10/+10
2015-04-02Auto merge of #23868 - mbrubeck:doc-edit, r=Manishearth 1.0.0-betabors-6/+6
r? @steveklabnik