summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2016-12-19Rollup merge of #38334 - frewsxcv:BuildHasherDefault, r=GuillaumeGomezSeo Sanghyeon-3/+37
Rewrite, improve documentation for `core::hash::BuildHasherDefault`. Fixes https://github.com/rust-lang/rust/issues/31242.
2016-12-16Address falloutAaron Turon-7/+7
2016-12-16Rewrite, improve documentation for `core::hash::BuildHasherDefault`.Corey Farwell-3/+37
Fixes https://github.com/rust-lang/rust/issues/31242.
2016-12-15Deprecate std::cell::RefCell::borrow_stateAaron Turon-0/+2
2016-12-15Stabilize std::cell::Ref::cloneAaron Turon-3/+1
2016-12-15Stabilize std::char::{encode_utf8, encode_utf16}Aaron Turon-2/+2
2016-12-15Stabilize std::sync::atomic::Atomic*::{get_mut, into_inner}Aaron Turon-12/+6
2016-12-15Stabilize Iterator::{min_by, max_by}Aaron Turon-2/+2
2016-12-13Auto merge of #38309 - sfackler:rfc-1725, r=alexcrichtonbors-0/+83
Implement RFC #1725 (read_unaligned, write_unaligned) cc #37955 r? @alexcrichton
2016-12-12Implement RFC #1725Steven Fackler-0/+83
cc #37955
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-1/+1
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-12-07Auto merge of #38149 - bluss:is-empty, r=alexcrichtonbors-1/+13
Forward more ExactSizeIterator methods and `is_empty` edits - Forward ExactSizeIterator methods in more places, like `&mut I` and `Box<I>` iterator impls. - Improve `VecDeque::is_empty` itself (see commit 4) - All the collections iterators now have `len` or `is_empty` forwarded if doing so is a benefit. In the remaining cases, they already use a simple size hint (using something like a stored `usize` value), which is sufficient for the default implementation of len and is_empty.
2016-12-07Auto merge of #38134 - bluss:iter-nth, r=aturonbors-1/+4
Remove Self: Sized from Iterator::nth It is an unnecessary restriction; nth neither needs self to be sized nor needs to be exempted from the trait object. It increases the utility of the nth method, because type specific implementations are available through `&mut I` or through an iterator trait object. It is a backwards compatible change due to the special cases of the `where Self: Sized` bound; it was already optional to include this bound in `Iterator` implementations.
2016-12-04iter: Forward ExactSizeIterator methods for &mut IUlrik Sverdrup-1/+8
2016-12-04core: Forward ExactSizeIterator::is_empty for BytesUlrik Sverdrup-0/+5
2016-12-03Rollup merge of #38090 - GuillaumeGomez:option_doc, r=frewsxcvCorey Farwell-0/+10
Add cloned example for Option r? @frewsxcv
2016-12-02core: Remove Self: Sized from Iterator::nthUlrik Sverdrup-1/+4
It is an unnecessary restriction; nth neither needs self to be sized nor needs to be exempted from the trait object. It increases the utility of the nth method, because type specific implementations are available through `&mut I` or through an iterator trait object. It is a backwards compatible change due to the special cases of the `where Self: Sized` bound; it was already optional to include this bound in `Iterator` implementations.
2016-11-30Auto merge of #38047 - canndrew:fmt-void-non-empty, r=blussbors-1/+3
Make core::fmt::Void a non-empty type. Adding back this change that was removed from PR #36449 because it's a fix and because I immediately hit a problem with it again when I started implementing my fix for #12609.
2016-11-30Update the bootstrap compilerAlex Crichton-1/+0
Now that we've got a beta build, let's use it!
2016-11-30Add cloned example for OptionGuillaume Gomez-0/+10
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-1/+1
Fixes #26554.
2016-11-28Make core::fmt::Void a non-empty type.Andrew Cann-1/+3
Because we handle artifically-constructed references to it in live code which is a totally broken thing to do.
2016-11-26Auto merge of #36340 - sfackler:slice-get-slice, r=alexcrichtonbors-168/+331
Implement RFC 1679 cc #35729 r? @alexcrichton
2016-11-26Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichtonbors-0/+5
Add rustbuild command `bench` Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks. `./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates. Fixes #37897
2016-11-26Overload get{,_mut}{,_unchecked}Steven Fackler-168/+331
2016-11-26Auto merge of #38015 - sanxiyn:rollup, r=sanxiynbors-4/+4
Rollup of 7 pull requests - Successful merges: #37962, #37963, #37967, #37978, #37985, #38001, #38010 - Failed merges:
2016-11-26Rollup merge of #37963 - bluss:iterator-docs, r=alexcrichtonSeo Sanghyeon-4/+4
Fix two small issues in iterator docs - `collect()` is a regular method, not an adaptor (does not return an Iterator). I just randomly picked `filter` as a third common adaptor to mention instead. - Fix example in `Map`'s docs so that it uses the DoubleEndedIterator implementation
2016-11-25Auto merge of #37961 - samestep:radices, r=frewsxcvbors-1/+1
Use "radices" instead of "radicum" The correct plural of "radix" is "radices" or "radixes", not "radicum".
2016-11-25rustbuild: Point to core and collections's external benchmarks.Ulrik Sverdrup-0/+5
2016-11-24Auto merge of #37944 - bluss:adaptors-are-empty, r=alexcrichtonbors-6/+57
Forward ExactSizeIterator::len and is_empty for important iterator adaptors Forward ExactSizeIterator::len and is_empty for important iterator adaptors Because some iterators will provide improved version of len and/or is_empty, adaptors should forward to those implementations if possible.
2016-11-24Auto merge of #37943 - bluss:exact-is-empty, r=alexcrichtonbors-2/+10
Implement better .is_empty() for slice and vec iterators These iterators can use a pointer comparison instead of computing the length.
2016-11-23Use "radices" instead of "radicum"Sam Estep-1/+1
2016-11-23core: Fix example for .map()Ulrik Sverdrup-1/+1
Make the example use DoubleEndedIterator for map, like it said it would.
2016-11-23core: Iterator docs, collect is not an adaptorUlrik Sverdrup-3/+3
2016-11-23core, collections: Implement better .is_empty() for slice and vec iteratorsUlrik Sverdrup-2/+10
These iterators can use a pointer comparison instead of computing the length.
2016-11-22core: Forward ExactSizeIterator methods for important iterator adaptorsUlrik Sverdrup-6/+57
2016-11-22Auto merge of #37834 - bluss:peek-none, r=BurntSushibors-23/+41
Make Peekable remember peeking a None Peekable should remember if a None has been seen in the `.peek()` method. It ensures that `.peek(); .peek();` or `.peek(); .next();` only advances the underlying iterator at most once. This does not by itself make the iterator fused. Thanks to @s3bk for the code in `fn peek()` itself. Fixes #37784
2016-11-20Auto merge of #37888 - bluss:chars-count, r=alexcrichtonbors-0/+16
Improve .chars().count() Use a simpler loop to count the `char` of a string: count the number of non-continuation bytes. Use `count += <conditional>` which the compiler understands well and can apply loop optimizations to. benchmark descriptions and results for two configurations: - ascii: ascii text - cy: cyrillic text - jp: japanese text - words ascii: counting each split_whitespace item from the ascii text - words jp: counting each split_whitespace item from the jp text ``` x86-64 rustc -Copt-level=3 name orig_ ns/iter cmov_ ns/iter diff ns/iter diff % count_ascii 1,453 (1755 MB/s) 1,398 (1824 MB/s) -55 -3.79% count_cy 5,990 (856 MB/s) 2,545 (2016 MB/s) -3,445 -57.51% count_jp 3,075 (1169 MB/s) 1,772 (2029 MB/s) -1,303 -42.37% count_words_ascii 4,157 (521 MB/s) 1,797 (1205 MB/s) -2,360 -56.77% count_words_jp 3,337 (1071 MB/s) 1,772 (2018 MB/s) -1,565 -46.90% x86-64 rustc -Ctarget-feature=+avx -Copt-level=3 name orig_ ns/iter cmov_ ns/iter diff ns/iter diff % count_ascii 1,444 (1766 MB/s) 763 (3343 MB/s) -681 -47.16% count_cy 5,871 (874 MB/s) 1,527 (3360 MB/s) -4,344 -73.99% count_jp 2,874 (1251 MB/s) 1,073 (3351 MB/s) -1,801 -62.67% count_words_ascii 4,131 (524 MB/s) 1,871 (1157 MB/s) -2,260 -54.71% count_words_jp 3,253 (1099 MB/s) 1,331 (2686 MB/s) -1,922 -59.08% ``` I briefly explored a more involved blocked algorithm (looking at 8 or more bytes at a time), but the code in this PR was always winning `count_words_ascii` in particular (counting many small strings); this solution is an improvement without tradeoffs.
2016-11-20Rollup merge of #37882 - ollie27:chars_last, r=blussGuillaume Gomez-0/+12
Optimise Chars::last() The default implementation of last() goes through the entire iterator but that's not needed here.
2016-11-20Optimise CharIndices::last()Oliver Middleton-0/+6
The default implementation of last() goes through the entire iterator but that's not needed here.
2016-11-19str: Improve .chars().count()Ulrik Sverdrup-0/+16
Use a simpler loop to count the `char` of a string: count the number of non-continuation bytes. Use `count += <conditional>` which the compiler understands well and can apply loop optimizations to.
2016-11-19Optimise Chars::last()Oliver Middleton-0/+6
The default implementation of last() goes through the entire iterator but that's not needed here.
2016-11-18Fix `fmt::Debug` for strings, e.g. for Chinese charactersTobias Bucher-97/+230
The problem occured due to lines like ``` 3400;<CJK Ideograph Extension A, First>;Lo;0;L;;;;;N;;;;; 4DB5;<CJK Ideograph Extension A, Last>;Lo;0;L;;;;;N;;;;; ``` in `UnicodeData.txt`, which the script previously interpreted as two characters, although it represents the whole range. Fixes #34318.
2016-11-17core::iter: Peekable should remember peeking a NoneUlrik Sverdrup-23/+41
Peekable must remember if a None has been seen in the `.peek()` method. It ensures that `.peek(); .peek();` or `.peek(); .next();` only advances the underlying iterator at most once. This does not by itself make the iterator fused.
2016-11-12Remove macro work-around.Mark-Simulacrum-8/+3
2016-11-12Rollup merge of #37727 - GuillaumeGomez:invalid_src, r=eddybEduard-Mihai Burtescu-2/+15
Fix invalid src url Fixes #37684. Thanks to @eddyb's help. r? @eddyb
2016-11-12Rollup merge of #37716 - GuillaumeGomez:mem_urls, r=@frewsxcvEduard-Mihai Burtescu-16/+23
Mem urls r? @steveklabnik
2016-11-12Rollup merge of #37698 - GuillaumeGomez:marker_urls, r=brsonEduard-Mihai Burtescu-21/+21
Add missing urls for marker's traits r? @steveklabnik
2016-11-12Rollup merge of #37669 - GuillaumeGomez:always_urls, r=brsonEduard-Mihai Burtescu-7/+15
Add missing urls for FusedIterator and TrustedLen traits r? @steveklabnik
2016-11-12Rollup merge of #37662 - wesleywiser:intrinsics_docs, r=aturonEduard-Mihai Burtescu-0/+418
Add documentation to some of the unstable intrinsics Part of #34338