about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2017-03-29Updated tracking issue for cmp::ReverseArmin Ronacher-3/+3
2017-03-29Auto merge of #40338 - GuillaumeGomez:pulldown-switch, r=frewsxcv,steveklabnikbors-1/+1
Replace hoedown with pull in rustdoc cc @rust-lang/docs
2017-03-29Fixing formatting issues #29377projektir-38/+42
2017-03-29Changed cmp::Reverse to unstableArmin Ronacher-3/+4
2017-03-28Fix external doc errorsGuillaume Gomez-1/+1
2017-03-28libcore: sort_unstable: remove unnecessary loop.Vadzim Dambrouski-1/+3
`other` is guaranteed to be less than `2 * len`.
2017-03-27Adding links for Atomics docs #29377projektir-38/+66
2017-03-27Rollup merge of #40832 - pftbest:fix_msp430, r=stjepangAlex Crichton-24/+32
libcore: fix compilation on 16bit target (MSP430). Since PR #40601 has been merged, libcore no longer compiles on MSP430. The reason is this code in `break_patterns`: ```rust let mut random = len; random ^= random << 13; random ^= random >> 17; random ^= random << 5; random &= modulus - 1; ``` It assumes that `len` is at least a 32 bit integer. As a workaround replace `break_patterns` with an empty function for 16bit targets. cc @stjepang cc @alexcrichton
2017-03-27Rollup merge of #40824 - donniebishop:fromstr_docexample, r=steveklabnikAlex Crichton-0/+33
FromStr implementation example Referencing #29375. Added example implementation of FromStr trait to API Documentation
2017-03-27Rollup merge of #40819 - donniebishop:master, r=alexcrichtonAlex Crichton-1/+3
Link ParseBoolError to from_str method of bool Referencing task in #29375. Sorry for not opening another branch on my fork for this. Was working on this early this morning and forgot to branch off master
2017-03-27Rollup merge of #40818 - theotherphil:master, r=steveklabnikAlex Crichton-22/+22
Don't stutter in operator trait descriptions Fixes first item on #29365. r? @steveklabnik
2017-03-26libcore: sort_unstable: improve randomization in break_patterns.Vadzim Dambrouski-24/+32
Select 3 random points instead of just 1. Also the code now compiles on 16bit architectures.
2017-03-25Change `try!` to `?`Donnie Bishop-2/+2
2017-03-25Rollup merge of #40820 - irfanhudda:fix-typo-algorithm, r=BurntSushiCorey Farwell-2/+2
Fix typo in dec2flt/algorithm.rs
2017-03-25Rollup merge of #40807 - stjepang:optimize-insertion-sort, r=alexcrichtonCorey Farwell-2/+2
Optimize insertion sort This change slightly changes the main iteration loop so that LLVM can optimize it more efficiently. Benchmark: ``` name before ns/iter after ns/iter diff ns/iter diff % slice::sort_unstable_small_ascending 39 (2051 MB/s) 38 (2105 MB/s) -1 -2.56% slice::sort_unstable_small_big_random 579 (2210 MB/s) 575 (2226 MB/s) -4 -0.69% slice::sort_unstable_small_descending 80 (1000 MB/s) 70 (1142 MB/s) -10 -12.50% slice::sort_unstable_small_random 396 (202 MB/s) 386 -10 -2.53% ``` The benchmark is not a fluke. I can see that performance on `small_descending` is consistently better after this change. I'm not 100% sure why this makes things faster, but my guess would be that `v.len()+1` to the compiler looks like it could in theory overflow.
2017-03-25Remove trailing whitespaceDonnie Bishop-6/+6
2017-03-25FromStr implementation exampleDonnie Bishop-0/+33
2017-03-25Fix typo in dec2flt/algorithm.rsIrfan Hudda-2/+2
2017-03-25Link ParseBoolError to from_str method of boolDonnie Bishop-1/+3
2017-03-25Don't stutter in operator descriptions #29365Phil Ellison-22/+22
2017-03-25Optimize insertion sortStjepan Glavina-2/+2
This change slightly changes the main iteration loop so that LLVM can optimize it more efficiently. Benchmark: name before ns/iter after ns/iter diff ns/iter diff % slice::sort_unstable_small_ascending 39 (2051 MB/s) 38 (2105 MB/s) -1 -2.56% slice::sort_unstable_small_big_random 579 (2210 MB/s) 575 (2226 MB/s) -4 -0.69% slice::sort_unstable_small_descending 80 (1000 MB/s) 70 (1142 MB/s) -10 -12.50% slice::sort_unstable_small_random 396 (202 MB/s) 386 -10 -2.53%
2017-03-23Rollup merge of #40715 - manuel-rhdt:patch-1, r=brsonCorey Farwell-3/+3
Fix doc error for ExactSizeIterator The code example in the trait documentation of ExactSizeIterator has an incorrect implementation of the len method that does not return the number of times the example iterator 'Counter' will iterate. This may confuse readers of the docs as the example code will compile but doesn't uphold the trait's contract. This is easily fixed by modifying the implementation of len and changing the assert statement to actually assert the correct behaviour. I also slightly modified a code comment to better reflect what the method returns.
2017-03-22Rollup merge of #40722 - stjepang:doc-consistency-fixes, r=steveklabnikCorey Farwell-30/+30
Various fixes to wording consistency in the docs A bunch of random fixes, added punctuation, plurals, backticks, and so on... r? @steveklabnik
2017-03-22Rollup merge of #40692 - SamWhited:consistent_str_docs_punctuation, r=bstrieCorey Farwell-1/+1
str: Make docs consistently punctuated Every so slightly pointless one character PR, but this was driving me nuts while reading the docs a moment ago (all the [other public structs](https://doc.rust-lang.org/std/str/index.html#structs) have descriptions that end in a full-stop).
2017-03-22Rollup merge of #40690 - GuillaumeGomez:fix-iter-docs, r=frewsxcvCorey Farwell-3/+3
Fix invalid linking in iter docs r? @rust-lang/docs
2017-03-22Tracking issue numbersSimonas Kazlauskas-10/+10
2017-03-22Checked (and unchecked) slicing for strings?Simonas Kazlauskas-51/+327
What is this magic‽
2017-03-22Various fixes to wording consistency in the docsStjepan Glavina-30/+30
2017-03-22Improved bounds for cmp::ReverseArmin Ronacher-6/+6
2017-03-22Fix the test for cmp::ReverseArmin Ronacher-1/+1
2017-03-22Added core::cmp::Reverse for sort_by_key reverse sortingArmin Ronacher-0/+34
2017-03-21Fix doc error for ExactSizeIteratorManuel-3/+3
The code example in the trait documentation of ExactSizeIterator has an incorrect implementation of the len method that does not return the number of times the example iterator 'Counter' will iterate. This may confuse readers of the docs as the example code will compile but doesn't uphold the trait's contract. This is easily fixed by modifying the implementation of len and changing the assert statement to actually assert the correct behaviour. I also slightly modified a code comment to better reflect what the method returns.
2017-03-21Fix invalid linking in iter docsGuillaume Gomez-3/+3
2017-03-21str: Make docs consistently punctuatedSam Whited-1/+1
2017-03-21Unit test heapsortStjepan Glavina-2/+11
2017-03-21Use partial insertion sortStjepan Glavina-54/+119
2017-03-21Tweak the constants a bitStjepan Glavina-5/+5
2017-03-21Fix grammarStjepan Glavina-3/+3
2017-03-21Faster sort_unstable on presorted inputsStjepan Glavina-13/+21
2017-03-21Address Alex's PR commentsStjepan Glavina-2/+0
2017-03-21Implement feature sort_unstableStjepan Glavina-22/+729
2017-03-20Rollup merge of #40671 - GuillaumeGomez:options-urls, r=frewsxcvCorey Farwell-4/+13
Add missing urls in Option enum r? @rust-lang/docs
2017-03-20Rollup merge of #40667 - DaseinPhaos:patch-4, r=GuillaumeGomezCorey Farwell-4/+4
Fix typo in `ptr` doc `sizeof` should be `size_of`
2017-03-20Rollup merge of #40332 - steveklabnik:extract-book, r=alexcrichtonCorey Farwell-10/+10
Extract book into a submodule Part of https://github.com/rust-lang/rust/issues/39588 We probably don't want to land this till after the beta branches on friday, but would still ❤️ a review from @alexcrichton , since I am a rustbuild noob. This pr: 1. removes the book 2. adds it back in as a submodule 3. the submodule includes both the old book and the new book 4. it also includes an index page explaining the difference in editions 5. it also includes redirect pages for the old book URLs. 6. so we build all that stuff too. r? @alexcrichton
2017-03-20Auto merge of #39628 - arielb1:shimmir, r=eddybbors-1/+36
Translate shims using MIR This removes one large remaining part of old trans.
2017-03-20Fix up various linkssteveklabnik-10/+10
The unstable book, libstd, libcore, and liballoc all needed some adjustment.
2017-03-20Add missing urls in Option enumGuillaume Gomez-4/+13
2017-03-20Fix typo in `ptr` docLuxko-4/+4
`sizeof` should be `size_of`
2017-03-20Auto merge of #40281 - jimmycuadra:try-from-from-str, r=aturonbors-13/+28
Rename TryFrom's associated type and implement str::parse using TryFrom. Per discussion on the tracking issue, naming `TryFrom`'s associated type `Error` is generally more consistent with similar traits in the Rust ecosystem, and what people seem to assume it should be called. It also helps disambiguate from `Result::Err`, the most common "Err". See https://github.com/rust-lang/rust/issues/33417#issuecomment-269108968. `TryFrom<&str>` and `FromStr` are equivalent, so have the latter provide the former to ensure that. Using `TryFrom` in the implementation of `str::parse` means types that implement either trait can use it. When we're ready to stabilize `TryFrom`, we should update `FromStr` to suggest implementing `TryFrom<&str>` instead for new code. See https://github.com/rust-lang/rust/issues/33417#issuecomment-277175994 and https://github.com/rust-lang/rust/issues/33417#issuecomment-277253827. Refs #33417.
2017-03-19Rollup merge of #40521 - TimNN:panic-free-shift, r=alexcrichtonCorey Farwell-18/+108
Implemente overflowing_sh* with new unchecked_sh* intrinsics Also update some 128 bit builtins to not rely on the constant evaluator to avoid checked operations. Fixes #40508. cc @nagisa, @alexcrichton Note: I still have a build running to see if the 128 bit changes worked (unoptimized builds take *forever* to compile), however at least the overflowing builtins no longer reference `core::panicking::panic`.