| Age | Commit message (Collapse) | Author | Lines |
|
Stabilize the `alloc` crate.
This implements RFC 2480:
* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md
Closes https://github.com/rust-lang/rust/issues/27783
|
|
As mentioned in
https://github.com/rust-lang/rust/issues/46006#issuecomment-345260633
|
|
This implements RFC 2480:
* https://github.com/rust-lang/rfcs/pull/2480
* https://github.com/rust-lang/rfcs/blob/master/text/2480-liballoc.md
Closes https://github.com/rust-lang/rust/issues/27783
|
|
Fix broken links on std::boxed doc page
r? @QuietMisdreavus
|
|
|
|
|
|
|
|
Allow Strings to be created from borrowed Strings. This is mostly
to make things like passing &String to an `impl Into<String>`
parameter frictionless.
|
|
Future-proof the Futures API
cc https://github.com/rust-lang/rust/issues/59113, @carllerche, @rust-lang/libs
r? @withoutboats
|
|
|
|
This updates the `Extend` implementations to use `for_each` for many
collections: `BinaryHeap`, `BTreeMap`, `BTreeSet`, `LinkedList`, `Path`,
`TokenStream`, `VecDeque`, and `Wtf8Buf`.
Folding with `for_each` enables better performance than a `for`-loop for
some iterators, especially if they can just forward to internal
iterators, like `Chain` and `FlatMap` do.
|
|
|
|
|
|
|
|
|
|
|
|
r=KodrAus
improve worst-case performance of BTreeSet intersection v3
Variation of [#59078](https://github.com/rust-lang/rust/pull/59078) with `Intersection` remaining a struct
r? @scottmcm
|
|
|
|
|
|
uninitialized -> uninit
into_initialized -> assume_init
read_initialized -> read
set -> write
|
|
Implement specialized nth_back() for Box and Windows.
Hi there, this is my first pull request to rust :-)
I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995.
I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.
|
|
Improved test output
|
|
we can now skip should_panic tests with the libtest harness
|
|
Move alloc::prelude::* to alloc::prelude::v1, make alloc a subset of std
This was one of the unresolved questions of https://github.com/rust-lang/rfcs/pull/2480. As the RFC says this is maybe not useful in the sense that we are unlikely to ever have a second version, but making the crate a true subset makes one less issue to think about if we stabilize it and later want to merge standard library crates and have Cargo feature flags to enable or disable parts of the `std` crate.
See also discussion in https://github.com/rust-lang/rust/pull/58175.
Also rename the feature gate and point to a dedicated tracking issue: https://github.com/rust-lang/rust/issues/58935
|
|
|
|
|
|
|
|
|
|
|
|
… to separate it from that of the crate.
New tracking issue: https://github.com/rust-lang/rust/issues/58935
|
|
This was one of the unresolved questions of https://github.com/rust-lang/rfcs/pull/2480.
As the RFC says this is maybe not useful in the sense that we are unlikely
to ever have a second version, but making the crate a true subset
makes one less issue to think about if we stabilize it and later
want to merge standard library crates and have Cargo feature flags
to enable or disable parts of the `std` crate.
See also discussion in https://github.com/rust-lang/rust/pull/58175
|
|
In bluss/indexmap#88, we found that there was no easy way to implement
`Debug` for our `IterMut` and `Drain` iterators. Those are built on
`slice::IterMut` and `vec::Drain`, which implement `Debug` themselves,
but have no other way to access their data. With a new `as_slice()`
method, we can read the data and customize its presentation.
|
|
Rollup of 14 pull requests
Successful merges:
- #58730 (Have all methods of Filter and FilterMap use internal iteration)
- #58780 (ManuallyDrop != MaybeUninit)
- #58782 (Replace `s` with `self` in docs for str methods taking self.)
- #58785 (allow specifying attributes for tool lints)
- #58802 (Ensure `record_layout_for_printing()` is inlined.)
- #58821 (Fixed a syntax error in the pin docs)
- #58830 (tidy: deny(rust_2018_idioms))
- #58832 (Revert switching to GCP on AppVeyor)
- #58833 (tools/rustbook: deny(rust_2018_idioms))
- #58835 (tools/remote-test-{client,server}: deny(rust_2018_idioms))
- #58838 (Fix typo in Vec#resize_with documentation)
- #58842 (Forbid duplicating Cargo as a dependency)
- #58852 (Update toolchain to build NetBSD release)
- #58865 (Fix C-variadic function printing)
|
|
|
|
|
|
Stabilize TryFrom and TryInto with a convert::Infallible empty enum
This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898
|
|
Remove some unnecessary 'extern crate'
cc #58099
r? @Centril
|
|
replace deprecated rustfmt_skip with rustfmt::skip
|
|
Relax some Ord bounds on BinaryHeap<T>
Notably, iterators don't require any trait bounds to be iterated.
|
|
|
|
Clarify guarantees for `Box` allocation
This basically says `Box` does the obvious things for its allocations.
See also: https://users.rust-lang.org/t/alloc-crate-guarantees/24981
This may require a T-libs FCP? Not sure.
r? @sfackler
|
|
|
|
Optimise vec![false; N] to zero-alloc
Nowadays booleans have a well-defined representation, so there is no reason not to optimise their allocation.
|
|
introduce benchmarks of BTreeSet.intersection
16 tests combining 4 kinds of contents with different sizes exposing edge cases.
The ones with asymmetric sizes are addressed by https://github.com/rust-lang/rust/pull/58577.
The pos_vs_neg cases seems (are were meant to be) the same as the neg_vs_pos case (same thing, reverse order) but reality shows a surprsing 25% difference.
|
|
fix overlapping references in BTree
This fixes two kinds of overlapping references in BTree (both found by running the BTree test suite in Miri).
In `into_slices_mut`, we did `k.into_key_slice_mut()` followed by `self.into_val_slice_mut()` (where `k` is a copy of `self`). Calling `into_val_slice_mut` calls `self.len()`, which creates a shared reference to `NodeHeader`, which unfortunately (due to padding) overlaps with the mutable reference returned by `into_key_slice_mut`. Hence the key slice got (partially) invalidated. The fix is to avoid creating an `&NodeHeader` after the first slice got created.
In the iterators, we used to first create the references that will be returned, and then perform the walk on the tree. Walking the tree creates references (such as `&mut InternalNode`) that overlap with all of the keys and values stored in a pointer; in particular, they overlap with the references the iterator will later return. This is fixed by reordering the operations of walking the tree and obtaining the inner references.
The test suite still passes (and it passes in Miri now!), but there is a lot of code here that I do not understand...
|
|
override `VecDeque::try_rfold`, also update iterator
This keeps the slice based iteration and updates the iterator state after each slice. It also uses a loop to reduce the amount of code.
This uses unsafe code, so some thorough review would be appreciated. Cc @RalfJung
|
|
Deprecate the unstable Vec::resize_default
As a way to either get additional feedback to stabilize or help move nightly users off it.
Tracking issue: https://github.com/rust-lang/rust/issues/41758#issuecomment-449719961
r? @SimonSapin
|
|
Nowadays booleans have a well-defined representation, so there is no reason not to optimise their allocation.
|
|
|
|
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
|