| Age | Commit message (Collapse) | Author | Lines |
|
Turn duration consts into associated consts
As suggested in https://github.com/rust-lang/rust/issues/57391#issuecomment-459658236, I'm moving `Duration` constants (`SECOND`, `MILLISECOND` and so on; currently behind unstable `duration_constants` feature) into the `impl Duration` block.
cc @frewsxcv @SimonSapin
|
|
RangeInclusive internal iteration performance improvement.
Specialize `Iterator::try_fold` and `DoubleEndedIterator::try_rfold` to improve code generation in all internal iteration scenarios.
This changes brings the performance of internal iteration with `RangeInclusive` on par with the performance of iteration with `Range`:
- Single conditional jump in hot loop,
- Unrolling and vectorization,
- And even Closed Form substitution.
Unfortunately, it only applies to internal iteration. Despite various attempts at stream-lining the implementation of `next` and `next_back`, LLVM has stubbornly refused to optimize external iteration appropriately, leaving me with a choice between:
- The current implementation, for which Closed Form substitution is performed, but which uses 2 conditional jumps in the hot loop when optimization fail.
- An implementation using a `is_done` boolean, which uses 1 conditional jump in the hot loop when optimization fail, allowing unrolling and vectorization, but for which Closed Form substitution fails.
In the absence of any conclusive evidence as to which usecase matters most, and with no assurance that the lack of Closed Form substitution is not indicative of other optimizations being foiled, there is no way
to pick one implementation over the other, and thus I defer to the statu quo as far as `next` and `next_back` are concerned.
|
|
Rollup of 17 pull requests
Successful merges:
- #57656 (Deprecate the unstable Vec::resize_default)
- #58059 (deprecate before_exec in favor of unsafe pre_exec)
- #58064 (override `VecDeque::try_rfold`, also update iterator)
- #58198 (Suggest removing parentheses surrounding lifetimes)
- #58431 (fix overlapping references in BTree)
- #58555 (Add a note about 2018e if someone uses `try {` in 2015e)
- #58588 (remove a bit of dead code)
- #58589 (cleanup macro after 2018 transition)
- #58591 (Dedup a rustdoc diagnostic construction)
- #58600 (fix small documentation typo)
- #58601 (Search for target_triple.json only if builtin target not found)
- #58606 (Docs: put Future trait into spotlight)
- #58607 (Fixes #58586: Make E0505 erronous example fail for the 2018 edition)
- #58615 (miri: explain why we use static alignment in ref-to-place conversion)
- #58620 (introduce benchmarks of BTreeSet.intersection)
- #58621 (Update miri links)
- #58632 (Make std feature list sorted)
Failed merges:
r? @ghost
|
|
Docs: put Future trait into spotlight
If a function returns a type that implements `Future`, there should be a small "i" symbol next to it indicating the return type implements an important trait.
|
|
Wrap write_bytes in a function. Move docs
This will allow us to add debug assertions.
See issue #53871.
|
|
improve Pin documentation
Incorporates a bunch of the documentation-related comments that came up when discussing `Pin` stabilization.
Cc @alexcrichton @withoutboats @cramertj @jonhoo
Fixes https://github.com/rust-lang/rust/issues/58130
|
|
r=dtolnay
Destabilize fixed-width const defined atomic integers
With this PR version 1.34.0 onwards const declarations of atomic integers will be unstable.
* Closes https://github.com/rust-lang/rust/issues/58089
* Reverts partially: https://github.com/rust-lang/rust/pull/57425
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-Authored-By: RalfJung <post@ralfj.de>
|
|
* With this PR 1.34.0 onwards const declarations of atomic integers will be
unstable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Make overflowing and wrapping negation const
Remember that the signed and unsigned versions are slightly different here, so there's four functions made const instead of just two.
|
|
Stabilize iter::successors and iter::from_fn
FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773, https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234
|
|
Fix typo in std::future::Future docs
I am not quite sure if this is actually a typo but
1. to me the sentence doesn't make sense if it says "expect"
2. I hope that `Future`s are not really allowed to cause memory unsafety if they are polled after completion.
|
|
Use more impl header lifetime elision
Inspired by seeing explicit lifetimes on these two:
- https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html#impl-FusedIterator
- https://doc.rust-lang.org/nightly/std/primitive.u32.html#impl-Not
And a follow-up to https://github.com/rust-lang/rust/pull/54687, that started using IHLE in libcore.
Most of the changes in here fall into two big categories:
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop`, `Debug`, and `Clone`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations [where the flipped one cannot elide the lifetime](https://internals.rust-lang.org/t/impl-type-parameter-aliases/9403/2?u=scottmcm).
I also removed two lifetimes that turned out to be completely unused; see https://github.com/rust-lang/rust/issues/41960#issuecomment-464557423
|
|
Add missing fmt structs examples
r? @rust-lang/docs
|
|
Remove UB in pointer tests
UB found by Miri.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Co-Authored-By: RalfJung <post@ralfj.de>
|
|
|
|
FCP: https://github.com/rust-lang/rust/issues/55977#issuecomment-463964234
|
|
FCP: https://github.com/rust-lang/rust/issues/58045#issuecomment-464674773
|
|
|
|
|
|
|
|
There are two big categories of changes in here
- Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`)
- Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`)
I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
|
|
update stdsimd and remove now-unused MaybeUninit::into_inner
That's a huge diff for stdsimd... Cc @gnzlbg @alexcrichton
|
|
|
|
|