summary refs log tree commit diff
path: root/src/libcore
AgeCommit message (Collapse)AuthorLines
2017-07-13Add a stability marker for core::cmp::Reverse.0Steven Fackler-1/+1
Closes #43027
2017-07-13Stabilize cmp::ReverseSteven Fackler-4/+3
Closes #40893
2017-06-22Change the for-loop desugar so the `break` does not affect type inference. ↵John Kåre Alsaker-2/+4
Fixes #42618
2017-06-04Auto merge of #42265 - Zoxc:for-sugar, r=eddybbors-3/+4
Change for-loop desugar to not borrow the iterator during the loop This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.
2017-06-02Rollup merge of #42310 - scottmcm:deprecate-range-stepby, r=alexcrichtonMark Simulacrum-13/+42
Deprecate range-specific `step_by` Deprecation attributes and test updates only. Was replaced by an any-iterator version in https://github.com/rust-lang/rust/pull/41439 Last follow-up (this release) to https://github.com/rust-lang/rust/pull/42110#issuecomment-303210138 r? @alexcrichton
2017-06-02Auto merge of #41670 - scottmcm:slice-rotate, r=alexcrichtonbors-0/+143
Add an in-place rotate method for slices to libcore A helpful primitive for moving chunks of data around inside a slice. For example, if you have a range selected and are drag-and-dropping it somewhere else (Example from [Sean Parent's talk](https://youtu.be/qH6sSOr-yk8?t=560)). (If this should be an RFC instead of a PR, please let me know.) Edit: changed example
2017-06-02Auto merge of #41418 - hirschenberger:prefetch-intrinsic, r=nagisabors-0/+47
Adding support for the llvm `prefetch` intrinsic Optimize `slice::binary_search` by using prefetching.
2017-06-01Change for-loop desugar to not borrow the iterator during the loopJohn Kåre Alsaker-3/+4
2017-06-01Adding support for the llvm `prefetch` intrinsicFalco Hirschenberger-0/+47
Related to #37251
2017-05-31Avoid range::step_by in another testScott McMurray-2/+2
2017-05-31Deprecate iter::range::StepByScott McMurray-0/+15
Only exposed as DeprecatedStepBy (as of PR 41439)
2017-05-31Deprecate Range*::step_byScott McMurray-13/+27
Changed all the tests except test_range_step to use Iterator::step_by.
2017-06-01Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakisCorey Farwell-17/+67
Lower `?` to `Try` instead of `Carrier` The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments. Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs. Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following: - https://github.com/pfpacket/rust-9p/blob/00206e34c680198a0ac7c2f066cc2954187d4fac/src/serialize.rs#L38 - https://github.com/peterdelevoryas/bufparse/blob/b1325898f4fc2c67658049196c12da82548af350/src/result.rs#L50 The other results appear to be files from libcore or its tests. I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better. r? @nikomatsakis Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.
2017-05-31Rollup merge of #42329 - rap2hpoutre:patch-6, r=steveklabnikMark Simulacrum-2/+2
fix links to "module-level documentation" see https://github.com/rust-lang/rust/issues/42267
2017-05-31Rollup merge of #42315 - scottmcm:rangefrom-sizehint, r=alexcrichtonMark Simulacrum-1/+8
RangeFrom should have an infinite size_hint Before, ```rust (0..).take(4).size_hint() == (0, Some(4)) ``` With this change, ```rust (0..).take(4).size_hint() == (4, Some(4)) ```
2017-05-31Rollup merge of #42252 - stjepang:clarify-alignof-docs, r=nikomatsakisMark Simulacrum-4/+4
Clarify the docs for align_of and its variants It's okay to have unaligned raw pointers and then use `ptr::write_unaligned` and `ptr::read_unaligned`. However, using unaligned `&T` and `&mut T` would be undefined behavior. The current documentation seems to indicate that everything has to be aligned, but in reality only references do. This PR changes the text of docs accordingly. r? @sfackler
2017-05-31Rollup merge of #42126 - clarcharr:into_docs, r=steveklabnikMark Simulacrum-1/+37
Clarify docs on implementing Into. This was suggested by @dtolnay in #40380. This explicitly clarifies in what circumstances you should implement `Into` instead of `From`.
2017-05-31fix links to "module-level documentation"Raphaël Huchet-2/+2
2017-05-31Give the `try_trait` feature its own tracking issueScott McMurray-7/+7
2017-05-30Add 'the'Stjepan Glavina-4/+4
2017-05-30RangeFrom should have an infinite size_hintScott McMurray-1/+8
This makes the size_hint from things like `take` more precise.
2017-05-28Clarify docs on implementing Into.Clar Charr-1/+37
2017-05-28Auto merge of #42167 - scottmcm:iter-stepby-sizehint, r=alexcrichtonbors-1/+95
Override size_hint and propagate ExactSizeIterator for iter::StepBy Generally useful, but also a prerequisite for moving a bunch of unit tests off `Range*::step_by`. A small non-breaking subset of https://github.com/rust-lang/rust/pull/42110 (which I closed). Includes two small documentation changes @ivandardi requested on that PR. r? @alexcrichton
2017-05-27Rollup merge of #42260 - stjepang:document-cmp-traits-agreement, r=alexcrichtonMark Simulacrum-2/+14
Docs: impls of PartialEq/PartialOrd/Ord must agree Fixes #41270. This PR brings two improvements to the docs: 1. Docs for `PartialEq`, `PartialOrd`, and `Ord` clarify that their implementations must agree. 2. Fixes a subtle bug in the Dijkstra example for `BinaryHeap`, where the impls are inconsistent. Thanks @Rufflewind for spotting the bug! r? @alexcrichton cc @frankmcsherry
2017-05-27Docs: impls of PartialEq/PartialOrd/Ord must agreeStjepan Glavina-2/+14
2017-05-27Clarify the docs for align_of and its variantsStjepan Glavina-4/+4
2017-05-26Auto merge of #42245 - frewsxcv:rollup, r=frewsxcvbors-5/+5
Rollup of 7 pull requests - Successful merges: #42169, #42215, #42216, #42224, #42230, #42236, #42241 - Failed merges:
2017-05-26Rollup merge of #42169 - scottmcm:new-step-trait-issue, r=alexcrichtonCorey Farwell-5/+5
Give step_trait a distinct tracking issue from step_by iterator_step_by has decoupled their futures, so the tracking issue should split. Old issue: https://github.com/rust-lang/rust/issues/27741 New issue: https://github.com/rust-lang/rust/issues/42168 r? @alexcrichton (another follow-up to closed PR https://github.com/rust-lang/rust/pull/42110#issuecomment-303176049)
2017-05-26Auto merge of #42014 - tbu-:pr_scan_not_fused, r=alexcrichtonbors-4/+0
Remove `FusedIterator` implementation of `iter::Scan` Fixes #41964. This is a breaking change.
2017-05-25Lower `?` to `Try` instead of `Carrier`Scott McMurray-17/+67
The easy parts of RFC 1859. (Just the trait and the lowering, none of the error message improvements nor the insta-stable impl for Option.)
2017-05-24Rollup merge of #42195 - SamWhited:fix_broken_link, r=steveklabnikMark Simulacrum-1/+1
fix broken link to nomicon in Unsize docs Add a missing link that is currently broken in the docs (see the last sentence of https://doc.rust-lang.org/std/marker/trait.Unsize.html)
2017-05-24Rollup merge of #42159 - Havvy:doc-drop, r=steveklabnikMark Simulacrum-0/+44
Document drop more. Adds two examples to Drop and describes the recursive drop on types that contain fields.
2017-05-24Rollup merge of #42134 - scottmcm:rangeinclusive-struct, r=aturonMark Simulacrum-232/+132
Make RangeInclusive just a two-field struct Not being an enum improves ergonomics and consistency, especially since NonEmpty variant wasn't prevented from being empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait. Implements merged https://github.com/rust-lang/rfcs/pull/1980; tracking issue https://github.com/rust-lang/rust/issues/28237. This is definitely a breaking change to anything consuming `RangeInclusive` directly (not as an Iterator) or constructing it without using the sugar. Is there some change that would make sense before this so compilation failures could be compatibly fixed ahead of time? r? @aturon (as FCP proposer on the RFC)
2017-05-24fix broken link to nomicon in Unsize docsSam Whited-1/+1
2017-05-23Give step_trait a distinct tracking issue from step_byScott McMurray-5/+5
iterator_step_by has decoupled their futures, so the tracking issue should split.
2017-05-23Update description of iter::StepByScott McMurray-1/+1
2017-05-23Override size_hint and propagate ExactSizeIterator for iter::StepByScott McMurray-0/+94
Generally useful, but also a prerequisite for moving a bunch of unit tests off Range::step_by.
2017-05-22Suggested changes by birkenfeldHavvy-6/+4
2017-05-22Adding links to option::Optionprojektir-26/+60
2017-05-22Fix trailing whitespace.Havvy-2/+2
2017-05-22Add description of how values are dropped to Drop trait.Havvy-1/+7
2017-05-22Add example of variable declaration drop order to Drop trait.Havvy-0/+12
2017-05-22Add example of recursive drop to Drop trait.Havvy-0/+28
2017-05-21Return a correct size_hint for degenerate inclusive rangesScott McMurray-0/+9
Fixes https://github.com/rust-lang/rust/issues/42135 Found while fixing run-pass/range_inclusive test failure.
2017-05-21Stop returning k from [T]::rotateScott McMurray-6/+4
2017-05-21Update slice_rotate to a real tracking numberScott McMurray-1/+1
2017-05-21Remove the optimization in ptr_swap_nScott McMurray-45/+3
It can be revisted later after the mem::swap optimizations land.
2017-05-21Add an in-place rotate method for slices to libcoreScott McMurray-0/+187
A helpful primitive for moving chunks of data around inside a slice. In particular, adding elements to the end of a Vec then moving them somewhere else, as a way to do efficient multiple-insert. (There's drain for efficient block-remove, but no easy way to block-insert.) Talk with another example: <https://youtu.be/qH6sSOr-yk8?t=560>
2017-05-21Make RangeInclusive just a two-field structScott McMurray-233/+124
Not being an enum improves ergonomics, especially since NonEmpty could be Empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait. Implements RFC 1980
2017-05-20Rollup merge of #42098 - japaric:gh42097, r=Mark-SimulacrumMark Simulacrum-0/+1
core: fix unused_macro warning when compiling the crate for a target with max-atomic-width = 0 fixes #42097