about summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2017-07-02Fix tidy errorsStjepan Glavina-3/+3
2017-07-01Delete deprecated & unstable range-specific `step_by`Scott McMurray-246/+16
Replacement: 41439 Deprecation: 42310 for 1.19 Fixes 41477
2017-07-02Stabilize feature sort_unstableStjepan Glavina-2/+2
2017-07-02Implement Eq/Hash/Debug etc. for unsized tuples.Masaki Hara-7/+23
2017-07-01Auto merge of #42991 - sfackler:unstable-rangeargument, r=alexcrichtonbors-168/+9
Revert "Stabilize RangeArgument" This reverts commit 143206d54d7558c2326212df99efc98110904fdb. From the discussion in #30877 it seems like this is premature.
2017-06-30Revert "Stabilize RangeArgument"Steven Fackler-168/+9
This reverts commit 143206d54d7558c2326212df99efc98110904fdb.
2017-06-30Track `iterator_for_each` in #42986Josh Stone-1/+1
2017-06-30Auto merge of #42782 - cuviper:iterator_for_each, r=alexcrichtonbors-0/+94
Add `Iterator::for_each` This works like a `for` loop in functional style, applying a closure to every item in the `Iterator`. It doesn't allow `break`/`continue` like a `for` loop, nor any other control flow outside the closure, but it may be a more legible style for tying up the end of a long iterator chain. This was tried before in #14911, but nobody made the case for using it with longer iterators. There was also `Iterator::advance` at that time which was more capable than `for_each`, but that no longer exists. The `itertools` crate has `Itertools::foreach` with the same behavior, but thankfully the names won't collide. The `rayon` crate also has a `ParallelIterator::for_each` where simple `for` loops aren't possible. > I really wish we had `for_each` on seq iterators. Having to use a > dummy operation is annoying. - [@nikomatsakis][1] [1]: https://github.com/nikomatsakis/rayon/pull/367#issuecomment-308455185
2017-06-29Rollup merge of #42920 - behnam:cmp, r=BurntSushiAriel Ben-Yehuda-4/+6
[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum types Expand Derivable docblock section for `Ord` and `PartialOrd` to cover `enum` types, in addition to the existing language explaining it for `struct` types.
2017-06-29Rollup merge of #42831 - rthomas:master, r=QuietMisdreavusAriel Ben-Yehuda-7/+4
Update docs for fmt::write. #29355 I reworded it slightly to make it more clear that the function only take two arguments - the output and the Arguments struct that can be generated from the format_args! macro. r? @steveklabnik
2017-06-28Auto merge of #42819 - scottmcm:swap-nonoverlapping, r=sfacklerbors-61/+86
Reuse the mem::swap optimizations to speed up slice::rotate This is most helpful for compound types where LLVM didn't vectorize the loop. Highlight: bench slice::rotate_medium_by727_strings gets 38% faster. Exposes the swapping logic from PR https://github.com/rust-lang/rust/pull/40454 as `pub unsafe fn ptr::swap_nonoverlapping` under library feature `swap_nonoverlapping` https://github.com/rust-lang/rust/issues/42818. (The new method seemed plausible, and was the simplest way to share the logic. I'm not attached to it, though, so let me know if a different way would be better.)
2017-06-28Auto merge of #42745 - sfackler:1.19-stabilization, r=alexcrichtonbors-13/+171
1.19 stabilization r? @alexcrichton
2017-06-28Auto merge of #42431 - nagisa:core-float-2, r=alexcrichtonbors-12/+24
Fix NaN handling in is_sign_negative/positive This would be my proposed fix for the #42425 provided we decide it is indeed a problem. Note this would technically be a breaking change to a stable API. We might want to consider deprecating these methods and adding new ones.
2017-06-27Use a little more compelling example of `for_each`Josh Stone-6/+7
2017-06-26[libcore/cmp] Expand Ord/PartialOrd Derivable doc for enum typesBehnam Esfahbod-4/+6
Expand Derivable docblock section for `Ord` and `PartialOrd` to cover `enum` types, in addition to the existing language explaining it for `struct` types.
2017-06-24Stabilize RangeArgumentSteven Fackler-9/+168
Move it and Bound to core::ops while we're at it. Closes #30877
2017-06-24Stabilize cmp::ReverseSteven Fackler-4/+3
Closes #40893
2017-06-24Auto merge of #42541 - gilescope:patch-1, r=alexcrichtonbors-8/+12
assert_eq failure message easier to read By having the left and right strings aligned with one another it helps spot the difference between the two far quicker than if they are on the same line. E.g. Before: ``` thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left: `"-aandb--S123.html"` right: `"-aandb-S123.html"`', ``` After: ``` thread 'tests::test_safe_filename' panicked at 'assertion failed: `(left == right)` left: `"-aandb--S123.html"` right: `"-aandb-S123.html"`', ``` When the strings are both on the same line it take a lot longer to spot the difference. It is a small change but the small time savings add up with repetition. This would help Rust be an excellent language to write tests in out of the box. Closes https://github.com/rust-lang/rust/issues/41615
2017-06-23Rollup merge of #42822 - ChrisMacNaughton:guard-traits, r=alexcrichtonMark Simulacrum-0/+14
Ensure Guard types impl Display & Debug Fixes #24372
2017-06-23Removed as many "```ignore" as possible.kennytm-19/+43
Replaced by adding extra imports, adding hidden code (`# ...`), modifying examples to be runnable (sorry Homura), specifying non-Rust code, and converting to should_panic, no_run, or compile_fail. Remaining "```ignore"s received an explanation why they are being ignored.
2017-06-22Adding training commer to be more consistent with prior format.Giles Cope-4/+4
2017-06-22Fix NaN handling in is_sign_negative/positiveSimonas Kazlauskas-12/+24
See #42425
2017-06-22Update docs for fmt::write.Ryan Thomas-7/+4
I reworded it slightly to make it more clear that the function only take two arguments - the output and the Arguments struct that can be generated from the format_args! macro. r? @steveklabnik
2017-06-22Auto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakisbors-2/+4
Change the for-loop desugar so the `break` does not affect type inference. Fixes #42618 Rewrite the `for` loop desugaring to avoid contaminating the inference results. Under the older desugaring, `for x in vec![] { .. }` would erroneously type-check, even though the type of `vec![]` is unconstrained. (written by @nikomatsakis)
2017-06-22Ensure Guard types impl Display & DebugChris MacNaughton-0/+14
Fixes #24372
2017-06-21Reuse the mem::swap optimizations to speed up slice::rotateScott McMurray-61/+86
Exposes the swapping logic from PR 40454 as `pub unsafe fn ptr::swap_nonoverlapping` under feature swap_nonoverlapping This is most helpful for compound types where LLVM didn't vectorize the loop. Highlight: bench slice::rotate_medium_by727_strings gets 38% faster.
2017-06-22Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoeristerbors-0/+3
Integrate jobserver support to parallel codegen This commit integrates the `jobserver` crate into the compiler. The crate was previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose here is to two-fold: * Primarily the compiler can cooperate with Cargo on parallelism. When you run `cargo build -j4` then this'll make sure that the entire build process between Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc instances which may all try to spawn lots of threads. * Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver. This means that if you call cargo/rustc from `make` or another jobserver-compatible implementation it'll use foreign parallelism settings instead of creating new ones locally. As the number of parallel codegen instances in the compiler continues to grow over time with the advent of incremental compilation it's expected that this'll become more of a problem, so this is intended to nip concurrent concerns in the bud by having all the tools to cooperate! Note that while rustc has support for itself creating a jobserver it's far more likely that rustc will always use the jobserver configured by Cargo. Cargo today will now set a jobserver unconditionally for rustc to use.
2017-06-21Use `fold` to implement `Iterator::for_each`Josh Stone-4/+51
The benefit of using internal iteration is shown in new benchmarks: test iter::bench_for_each_chain_fold ... bench: 635,110 ns/iter (+/- 5,135) test iter::bench_for_each_chain_loop ... bench: 2,249,983 ns/iter (+/- 42,001) test iter::bench_for_each_chain_ref_fold ... bench: 2,248,061 ns/iter (+/- 51,940)
2017-06-21Rollup merge of #42762 - jackpot51:patch-1, r=sfacklerCorey Farwell-2/+2
Disable repr(simd) in mem::swap on Redox This addresses https://github.com/rust-lang/rust/issues/42761
2017-06-21Rollup merge of #42620 - wesleywiser:compile_error, r=brsonCorey Farwell-0/+11
Add compile_error! Related to #40872
2017-06-21Integrate jobserver support to parallel codegenAlex Crichton-0/+3
This commit integrates the `jobserver` crate into the compiler. The crate was previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose here is to two-fold: * Primarily the compiler can cooperate with Cargo on parallelism. When you run `cargo build -j4` then this'll make sure that the entire build process between Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc instances which may all try to spawn lots of threads. * Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver. This means that if you call cargo/rustc from `make` or another jobserver-compatible implementation it'll use foreign parallelism settings instead of creating new ones locally. As the number of parallel codegen instances in the compiler continues to grow over time with the advent of incremental compilation it's expected that this'll become more of a problem, so this is intended to nip concurrent concerns in the bud by having all the tools to cooperate! Note that while rustc has support for itself creating a jobserver it's far more likely that rustc will always use the jobserver configured by Cargo. Cargo today will now set a jobserver unconditionally for rustc to use.
2017-06-20Add `Iterator::for_each`Josh Stone-0/+46
This works like a `for` loop in functional style, applying a closure to every item in the `Iterator`. It doesn't allow `break`/`continue` like a `for` loop, nor any other control flow outside the closure, but it may be a more legible style for tying up the end of a long iterator chain. This was tried before in #14911, but nobody made the case for using it with longer iterators. There was also `Iterator::advance` at that time which was more capable than `for_each`, but that no longer exists. The `itertools` crate has `Itertools::foreach` with the same behavior, but thankfully the names won't collide. The `rayon` crate also has a `ParallelIterator::for_each` where simple `for` loops aren't possible. > I really wish we had `for_each` on seq iterators. Having to use a > dummy operation is annoying. - [@nikomatsakis][1] [1]: https://github.com/nikomatsakis/rayon/pull/367#issuecomment-308455185
2017-06-20Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichtonCorey Farwell-1/+69
add `FromStr` Impl for `char` fixes #24939. is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?
2017-06-20added `FromStr` Impl for `char`tinaun-1/+69
2017-06-20Whitespace changeGiles Cope-2/+2
2017-06-19Bump version and stage0 compilerAlex Crichton-96/+6
2017-06-19Disable repr(simd) in mem::swap on RedoxJeremy Soller-2/+2
2017-06-19Merge remote-tracking branch 'upstream/master'Giles Cope-3112/+3547
2017-06-19Add compile_error!Wesley Wiser-0/+11
Related to #40872
2017-06-17Inline StrSearcher::haystack()Alexander Bulaev-1/+4
2017-06-16Rollup merge of #42705 - est31:master, r=alexcrichtonCorey Farwell-2/+2
Introduce tidy lint to check for inconsistent tracking issues This PR * Refactors the collect_lib_features function to work in a non-checking mode (no bad pointer needed, and list of lang features). * Introduces checking whether unstable/stable tags for a given feature have inconsistent tracking issues, as in, multiple tracking issues per feature. * Fixes such inconsistencies throughout the codebase.
2017-06-16Introduce tidy lint to check for inconsistent tracking issuesest31-2/+2
This commit * Refactors the collect_lib_features function to work in a non-checking mode (no bad pointer needed, and list of lang features). * Introduces checking whether unstable/stable tags for a given feature have inconsistent tracking issues. * Fixes such inconsistencies throughout the codebase.
2017-06-16Auto merge of #42430 - nagisa:core-float, r=alexcrichtonbors-0/+118
Re-implement float min/max in rust This also adds the relevant implementations into libcore. See #42423
2017-06-16Auto merge of #42631 - malbarbo:wasm32, r=alexcrichtonbors-0/+8
Add a travis builder for wasm32-unknown-emscripten This commits add an entry to travis matrix that will execute wasm32-unknown-emscripten tests suites. - Emscripten for asmjs was updated to sdk-1.37.13-64bit - The tests are run with node 8.0.0 (it can execute wasm) - A wrapper script is used to run each test from the directory where it is (workaround for https://github.com/kripken/emscripten/issues/4542) - Some tests are ignore, see #42629 and #42630
2017-06-15Auto merge of #42648 - murarth:merge-alloc-collections, r=alexcrichtonbors-1/+1
Merge crate `collections` into `alloc` This is a necessary step in order to merge #42565
2017-06-15Add hint about the return code of panic!Stefan Schindler-1/+1
2017-06-14Re-implement float min/max in rustSimonas Kazlauskas-0/+118
See #42423
2017-06-15Update older URLs pointing to the first edition of the BookWonwoo Choi-8/+8
`compiler-plugins.html` is moved into the Unstable Book. Explanation is slightly modified to match the change.
2017-06-14Auto merge of #42523 - clarcharr:refactor_ops, r=brsonbors-3021/+3163
Refactor ops.rs This refactors ops.rs into several different modules internally, as the file has gotten quite big. None of these modules are actually exported, but this should make maintaining it much easier. I've avoided the ambition of exporting the modules because they can more easily be rearranged after this commit goes through, even though it'd be cool to potentially export the modules in the future. I've separated the creation of each file into a separate commit so that this is easier to read. Redone version of #42269 with the movement of `RangeArgument` moved.
2017-06-13Merge crate `collections` into `alloc`Murarth-1/+1