summary refs log tree commit diff
path: root/src/libcollections
AgeCommit message (Collapse)AuthorLines
2016-04-12std: Stabilize APIs for the 1.9 releaseAlex Crichton-25/+36
This commit applies all stabilizations, renamings, and deprecations that the library team has decided on for the upcoming 1.9 release. All tracking issues have gone through a cycle-long "final comment period" and the specific APIs stabilized/deprecated are: Stable * `std::panic` * `std::panic::catch_unwind` (renamed from `recover`) * `std::panic::resume_unwind` (renamed from `propagate`) * `std::panic::AssertUnwindSafe` (renamed from `AssertRecoverSafe`) * `std::panic::UnwindSafe` (renamed from `RecoverSafe`) * `str::is_char_boundary` * `<*const T>::as_ref` * `<*mut T>::as_ref` * `<*mut T>::as_mut` * `AsciiExt::make_ascii_uppercase` * `AsciiExt::make_ascii_lowercase` * `char::decode_utf16` * `char::DecodeUtf16` * `char::DecodeUtf16Error` * `char::DecodeUtf16Error::unpaired_surrogate` * `BTreeSet::take` * `BTreeSet::replace` * `BTreeSet::get` * `HashSet::take` * `HashSet::replace` * `HashSet::get` * `OsString::with_capacity` * `OsString::clear` * `OsString::capacity` * `OsString::reserve` * `OsString::reserve_exact` * `OsStr::is_empty` * `OsStr::len` * `std::os::unix::thread` * `RawPthread` * `JoinHandleExt` * `JoinHandleExt::as_pthread_t` * `JoinHandleExt::into_pthread_t` * `HashSet::hasher` * `HashMap::hasher` * `CommandExt::exec` * `File::try_clone` * `SocketAddr::set_ip` * `SocketAddr::set_port` * `SocketAddrV4::set_ip` * `SocketAddrV4::set_port` * `SocketAddrV6::set_ip` * `SocketAddrV6::set_port` * `SocketAddrV6::set_flowinfo` * `SocketAddrV6::set_scope_id` * `<[T]>::copy_from_slice` * `ptr::read_volatile` * `ptr::write_volatile` * The `#[deprecated]` attribute * `OpenOptions::create_new` Deprecated * `std::raw::Slice` - use raw parts of `slice` module instead * `std::raw::Repr` - use raw parts of `slice` module instead * `str::char_range_at` - use slicing plus `chars()` plus `len_utf8` * `str::char_range_at_reverse` - use slicing plus `chars().rev()` plus `len_utf8` * `str::char_at` - use slicing plus `chars()` * `str::char_at_reverse` - use slicing plus `chars().rev()` * `str::slice_shift_char` - use `chars()` plus `Chars::as_str` * `CommandExt::session_leader` - use `before_exec` instead. Closes #27719 cc #27751 (deprecating the `Slice` bits) Closes #27754 Closes #27780 Closes #27809 Closes #27811 Closes #27830 Closes #28050 Closes #29453 Closes #29791 Closes #29935 Closes #30014 Closes #30752 Closes #31262 cc #31398 (still need to deal with `before_exec`) Closes #31405 Closes #31572 Closes #31755 Closes #31756
2016-04-05Add example doc for ToOwned traitGuillaume Gomez-0/+12
2016-04-01Implement `values_mut` on `BTreeMap`.Corey Farwell-0/+60
https://github.com/rust-lang/rust/issues/32551
2016-03-31Auto merge of #32586 - seanmonstar:speialize-to-string, r=alexcrichtonbors-1/+10
specialize ToString for str If there was some conditional compiling we could do, such that this impl only exists in nightly, and is turned off in beta/stable, I think that'd be an improvement here, as we could test specialization out without affecting stable builds.
2016-03-30specialize ToString for strSean McArthur-1/+10
2016-03-30Rollup merge of #32607 - tshepang:we-gots-intoiterator, r=apasel422Steve Klabnik-1/+1
doc: no need for an explicit iter()
2016-03-30Rollup merge of #32603 - tshepang:capitalise, r=blussSteve Klabnik-1/+1
doc: first letter should be upper case
2016-03-30doc: no need for an explicit iter()Tshepang Lekhonkhobe-1/+1
2016-03-28Auto merge of #32438 - kamalmarhubi:intoiterator-example, r=steveklabnikbors-24/+24
style: Use `iter` for IntoIterator parameter names This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-29doc: first letter should be upper caseTshepang Lekhonkhobe-1/+1
2016-03-28style: Use `iter` for IntoIterator parameter namesKamal Marhubi-24/+24
This commit standardizes the codebase on `iter` for parameters with IntoIterator bounds. Previously about 40% of IntoIterator parameters were named `iterable`, with most of the rest being named `iter`. There was a single place where it was named `iterator`.
2016-03-28Rollup merge of #32177 - srinivasreddy:remove_integer_suffixes, r=steveklabnikSteve Klabnik-8/+8
first round of removal of integer suffixes
2016-03-22std: Change `encode_utf{8,16}` to return iteratorsAlex Crichton-20/+5
Currently these have non-traditional APIs which take a buffer and report how much was filled in, but they're not necessarily ergonomic to use. Returning an iterator which *also* exposes an underlying slice shouldn't result in any performance loss as it's just a lazy version of the same implementation, and it's also much more ergonomic! cc #27784
2016-03-15Use issue number from rust-lang/rust, not rust-lang/rfcs.Stu Black-2/+2
2016-03-14Expose the key of Entry variants for HashMap and BTreeMap.Stu Black-0/+13
2016-03-13Call str::to_owned in String::from and uninline itUlrik Sverdrup-14/+2
String::from does not need to be inlined, it can be without it just like str::to_owned and String::clone are.
2016-03-12std: Clean out deprecated APIsAlex Crichton-85/+7
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
2016-03-12Rollup merge of #32137 - nathankleyn:improve-docs-for-binaryheap, r=steveklabnikManish Goregaokar-0/+144
Add missing documentation examples for BinaryHeap. As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BinaryHeap` collection type. This is part of issue #29348. r? @steveklabnik
2016-03-11removed integer suffixes in libcollections and libcollectionstestsrinivasreddy-8/+8
2016-03-11Auto merge of #32133 - alexcrichton:linkchecker, r=brsonbors-31/+39
Add a link validator to rustbuild This commit was originally targeted at just adding a link checking script to the rustbuild system. This ended up snowballing a bit to extend rustbuild to be amenable to various tools we have as part of the build system in general. There's a new `src/tools` directory which has a number of scripts/programs that are purely intended to be used as part of the build system and CI of this repository. This is currently inhabited by rustbook, the error index generator, and a new linkchecker script added as part of this PR. I suspect that more tools like compiletest, tidy scripts, snapshot scripts, etc will migrate their way into this directory over time. The commit which adds the error index generator shows the steps necessary to add new tools to the build system, namely: 1. New steps are defined for building the tool and running the tool 2. The dependencies are configured 3. The steps are implemented In terms of the link checker, these commits do a few things: * A new `src/tools/linkchecker` script is added. This will read an entire documentation tree looking for broken relative links (HTTP links aren't followed yet). * A large number of broken links throughout the documentation were fixed. Many of these were just broken when viewed from core as opposed to std, but were easily fixed. * A few rustdoc bugs here and there were fixed
2016-03-10Remove unnecessary mut in docs causing test failures.Nathan Kleyn-1/+1
2016-03-10Rollup merge of #32136 - nathankleyn:improve-docs-for-btreeset, r=steveklabnikSteve Klabnik-0/+30
Add missing documentation examples for BTreeSet. As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BTreeSet` collection type. This is part of issue #29348. r? @steveklabnik
2016-03-09collections: Fix broken doc exampleAlex Crichton-1/+1
PR #32135 was accidentally merged without tests passing, and unfortunately one of the tests added was broken, so this fixes that.
2016-03-10Merge pull request #32135 from nathankleyn/improve-docs-for-btreemapSteve Klabnik-0/+111
Add missing documentation examples for BTreeMap.
2016-03-09Add missing "basic usage" sections to docs, fix review comments.Nathan Kleyn-1/+36
2016-03-09Address review comments to add "basic usage" sections to docs.Nathan Kleyn-0/+38
2016-03-08Add missing documentation examples for BinaryHeap.Nathan Kleyn-0/+106
As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BinaryHeap` collection type. This is part of issue #29348.
2016-03-08Add missing documentation examples for BTreeSet.Nathan Kleyn-0/+30
As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BTreeSet` collection type. This is part of issue #29348.
2016-03-08Add missing documentation examples for BTreeMap.Nathan Kleyn-0/+76
As part of the ongoing effort to document all methods with examples, this commit adds the missing examples for the `BTreeMap` collection type. This is part of issue #29348.
2016-03-08doc: Fix a bunch of broken linksAlex Crichton-31/+39
A few categories: * Links into compiler docs were just all removed as we're not generating compiler docs. * Move up one more level to forcibly go to std docs to fix inlined documentation across the facade crates.
2016-03-08Rollup merge of #32084 - gokhanettin:typo-in-comment, r=alexcrichtonSteve Klabnik-5/+5
Fix typos - mismatching parentheses in comments Fixes mismatching parentheses in the comments of precision example. r? @steveklabnik
2016-03-07Auto merge of #32051 - steveklabnik:gh9447, r=blussbors-1/+1
Fixes #9447
2016-03-06Fix typos - mismatching parentheses in commentsGökhan Karabulut-5/+5
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-2/+67
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-04End stdlib module summaries with a full stop.Steve Klabnik-1/+1
Fixes #9447
2016-03-03Auto merge of #31797 - apasel422:issue-28950, r=alexcrichtonbors-2/+4
Closes #28950. r? @eddyb
2016-03-03Auto merge of #32012 - bluss:more-drop-in-place, r=alexcrichtonbors-12/+13
Use `drop_in_place` in Vec and VecDeque We can use drop_in_place's DST capabilities directly in Vec::drop and similarly in VecDeque::drop. I verfied this has the same effect as the previous `needs_drop` code; `drop_in_place` it itself an intrinsic. The VecDeque replacement should be more efficient too, even in release mode (slice iteration makes a more efficient loop than the deque iterator).
2016-03-02Use ptr::drop_in_place in VecDeque::dropUlrik Sverdrup-1/+6
Just like for Vec. This should benefit both non-optimized and optimized performance. Non-optimized since the intrinsic drop_in_place is easily removed, and optimized because iterating the slices is more efficient than using the VecDeque iterators.
2016-03-02Use ptr::drop_in_place in Vec::truncateUlrik Sverdrup-3/+4
2016-03-02Use ptr::drop_in_place in Vec::dropUlrik Sverdrup-8/+3
Directly use the drop glue for [T]. Still optimizes out in -O1 like with the `needs_drop` intrinsic.
2016-02-29std: Stabilize APIs for the 1.8 releaseAlex Crichton-4/+16
This commit is the result of the FCPs ending for the 1.8 release cycle for both the libs and the lang suteams. The full list of changes are: Stabilized * `braced_empty_structs` * `augmented_assignments` * `str::encode_utf16` - renamed from `utf16_units` * `str::EncodeUtf16` - renamed from `Utf16Units` * `Ref::map` * `RefMut::map` * `ptr::drop_in_place` * `time::Instant` * `time::SystemTime` * `{Instant,SystemTime}::now` * `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier` * `{Instant,SystemTime}::elapsed` * Various `Add`/`Sub` impls for `Time` and `SystemTime` * `SystemTimeError` * `SystemTimeError::duration` * Various impls for `SystemTimeError` * `UNIX_EPOCH` * `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign` Deprecated * Scoped TLS (the `scoped_thread_local!` macro) * `Ref::filter_map` * `RefMut::filter_map` * `RwLockReadGuard::map` * `RwLockWriteGuard::map` * `Condvar::wait_timeout_with` Closes #27714 Closes #27715 Closes #27746 Closes #27748 Closes #27908 Closes #29866
2016-02-27add indexing with RangeInclusive in libcore and libcollectionsAlex Burka-2/+66
2016-02-27note work still to be doneAlex Burka-0/+1
In particular, uses of inclusive ranges within the standard library are still waiting. Slices and collections can be sliced with `usize` and `Range*<usize>`, but not yet `Range*Inclusive<usize>`. Also, we need to figure out what to do about `RangeArgument`. Currently it has `start()` and `end()` methods which are pretty much identical to `Range::start` and `Range::end`. For the same reason as Range itself, these methods can't express a range such as `0...255u8` without overflow. The easiest choice, it seems to me, is either changing the meaning of `end()` to be inclusive, or adding a new method, say `last()`, that is inclusive and specifying that `end()` returns `None` in cases where it would overflow. Changing the semantics would be a breaking change, but `RangeArgument` is unstable so maybe we should do it anyway.
2016-02-27Improve formatting of the primitive str documentationMichael Huynh-17/+35
Adds extra documentation links for library types and methods to be consistent with similar items already linked. Also includes minor formatting fixes.
2016-02-26Auto merge of #31834 - ubsan:copy_from_slice, r=alexcrichtonbors-0/+25
implements rust-lang/rfcs#1419 r? alexcrichton
2016-02-25Add unstable copy_from_sliceNicholas Mazzuca-0/+25
2016-02-25Use `box` syntax in `vec!` macroAndrew Paseltiner-2/+4
Closes #28950.
2016-02-25Rollup merge of #31850 - GuillaumeGomez:vec-doc, r=steveklabnikManish Goregaokar-0/+43
r? @steveklabnik cc @mbrubeck
2016-02-25Rollup merge of #31784 - urschrei:chunks_doc, r=steveklabnikManish Goregaokar-2/+2
Closes #31773 r? @steveklabnik
2016-02-24Add more explanation on vec typeGuillaume Gomez-0/+43