| Age | Commit message (Collapse) | Author | Lines |
|
Closes #43027
|
|
Closes #40893
|
|
Fixes #42618
|
|
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.
|
|
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
|
|
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
|
|
Adding support for the llvm `prefetch` intrinsic
Optimize `slice::binary_search` by using prefetching.
|
|
|
|
Related to #37251
|
|
|
|
Only exposed as DeprecatedStepBy (as of PR 41439)
|
|
Changed all the tests except test_range_step to use Iterator::step_by.
|
|
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`.
|
|
fix links to "module-level documentation"
see https://github.com/rust-lang/rust/issues/42267
|
|
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))
```
|
|
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
|
|
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`.
|
|
|
|
|
|
|
|
This makes the size_hint from things like `take` more precise.
|
|
|
|
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
|
|
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
|
|
|
|
|
|
Rollup of 7 pull requests
- Successful merges: #42169, #42215, #42216, #42224, #42230, #42236, #42241
- Failed merges:
|
|
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)
|
|
Remove `FusedIterator` implementation of `iter::Scan`
Fixes #41964.
This is a breaking change.
|
|
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.)
|
|
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)
|
|
Document drop more.
Adds two examples to Drop and describes the recursive drop on types that contain fields.
|
|
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)
|
|
|
|
iterator_step_by has decoupled their futures, so the tracking issue should split.
|
|
|
|
Generally useful, but also a prerequisite for moving a bunch of unit tests off Range::step_by.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/42135
Found while fixing run-pass/range_inclusive test failure.
|
|
|
|
|
|
It can be revisted later after the mem::swap optimizations land.
|
|
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>
|
|
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
|
|
core: fix unused_macro warning
when compiling the crate for a target with max-atomic-width = 0
fixes #42097
|