| Age | Commit message (Collapse) | Author | Lines |
|
pnkfelix:issue-80949-short-term-resolution-via-revert-of-pr-78373, r=matthewjasper
Revert 78373 ("dont leak return value after panic in drop")
Short term resolution for issue #80949.
Reopen #47949 after this lands.
(We plan to fine-tune PR #78373 to not run into this problem.)
|
|
BTreeMap: make test cases more explicit on failure
r? `@Mark-Simulacrum`
|
|
|
|
|
|
BTreeMap: relax the explicit borrow rule to make code shorter and safer
Expressions like `.reborrow_mut().into_len_mut()` are annoyingly long, and kind of dangerous for the reason `reborrow_mut()` is unsafe. By relaxing the single rule, we no longer have to make an exception for functions with a `borrow` name and functions like `as_leaf_mut`. This is largely restoring the declaration style of the btree::node API about a year ago, but with more explanation and consistency.
r? `@Mark-Simulacrum`
|
|
Stabilize or_insert_with_key
Stabilizes the `or_insert_with_key` feature from https://github.com/rust-lang/rust/issues/71024. This allows inserting key-derived values when a `HashMap`/`BTreeMap` entry is vacant.
The difference between this and `.or_insert_with(|| ... )` is that this provides a reference to the key to the closure after it is moved with `.entry(key_being_moved)`, avoiding the need to copy or clone the key.
|
|
Fix overflow when converting ZST Vec to VecDeque
```rust
let v = vec![(); 100];
let queue = VecDeque::from(v);
println!("{:?}", queue);
```
This code will currently panic with a capacity overflow.
This PR resolves this issue and makes the code run fine.
Resolves #78532
|
|
|
|
BTreeSet: simplify implementation of pop_first/pop_last
…and stop it interfering in #79245.
r? ```````@Mark-Simulacrum```````
|
|
BTreeMap: more expressive local variables in merge
r? ```````@Mark-Simulacrum```````
|
|
|
|
BTreeMap: declare clear_parent_link directly on the root it needs
r? `@Mark-Simulacrum`
|
|
BTreeMap: detect bulk_steal's count-1 underflow in release builds too
r? `@Mark-Simulacrum`
|
|
BTreeMap: clarify comments and panics around choose_parent_kv
Fixes a lie in recent code: `unreachable!("empty non-root node")` should shout "empty internal node", but it might as well be good and keep quiet
r? `@Mark-Simulacrum`
|
|
|
|
|
|
|
|
|
|
Rollup of 12 pull requests
Successful merges:
- #79360 (std::iter: document iteration over `&T` and `&mut T`)
- #79398 (Link loop/for keyword)
- #79834 (Remove deprecated linked_list_extras methods.)
- #79845 (Fix rustup support in default_build_triple for python3)
- #79940 (fix more clippy::complexity findings)
- #79942 (Add post-init hook for static memory for miri.)
- #79954 (Fix building compiler docs with stage 0)
- #79963 (Fix typo in `DebruijnIndex` documentation)
- #79970 (Misc rustbuild improvements when the LLVM backend isn't used)
- #79973 (rustdoc light theme: Fix CSS for selected buttons)
- #79984 (Remove an unused dependency that made `rustdoc` crash)
- #79985 (Fixes submit event of the search input)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove deprecated linked_list_extras methods.
https://github.com/rust-lang/rust/issues/27794#issuecomment-667524201:
> I'd say give it about 2 weeks then remove them.
It's been 18 weeks. Time to remove them. :)
Closes #27794.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Don't leak return value after panic in drop
Closes #47949
|
|
|
|
|
|
|
|
|
|
BTreeMap/BTreeSet: make public doc more consistent
Tweaks #72876 and #73667 and propagate them to `BTreeSet`.
|
|
BTreeMap: cut out the ceremony around BoxedNode
The opposite direction of #79093.
r? ``@Mark-Simulacrum``
|
|
|
|
|
|
plus a small edit for clarity
|
|
BTreeMap: swap the names of NodeRef::new and Root::new_leaf
#78104 preserved the name of Root::new_leaf to minimize changes, but the resulting names are confusing.
r? `@Mark-Simulacrum`
|
|
BTreeMap: fix minor testing mistakes in #78903
Mostly a duplicate test case
r? `@Mark-Simulacrum`
|
|
BTreeMap: address namespace conflicts
Fix an annoyance popping up whenever synchronizing the test cases with a version capable of miri-track-raw-pointers.
r? `@Mark-Simulacrum`
|
|
|
|
|
|
|
|
|
|
|
|
BTreeMap: test chaotic ordering & other bits & bobs
r? `@Mark-Simulacrum`
|
|
Rename/Deprecate LayoutErr in favor of LayoutError
Implements rust-lang/wg-allocators#73.
This patch renames LayoutErr to LayoutError, and uses a type alias to support users using the old name.
The new name will be instantly stable in release 1.49 (current nightly), the type alias will become deprecated in release 1.51 (so that when the current nightly is 1.51, 1.49 will be stable).
This is the only error type in `std` that ends in `Err` rather than `Error`, if this PR lands all stdlib error types will end in `Error` :smiling_face_with_three_hearts:
|
|
BTreeMap: fix pointer provenance rules in underfullness
Continuing on #78480, and for readability, and possibly for performance: avoid aliasing when handling underfull nodes, and consolidate the code doing that. In particular:
- Avoid the rather explicit aliasing for internal nodes in `remove_kv_tracking`.
- Climb down to the root to handle underfull nodes using a reborrowed handle, rather than one copied with `ptr::read`, before resuming on the leaf level.
- Integrate the code tracking leaf edge position into the functions performing changes, rather than bolting it on.
r? `@Mark-Simulacrum`
|
|
Implement BTreeMap::retain and BTreeSet::retain
Adds new methods `BTreeMap::retain` and `BTreeSet::retain`. These are implemented on top of `drain_filter` (#70530).
The API of these methods is identical to `HashMap::retain` and `HashSet::retain`, which were implemented in #39560 and stabilized in #36648. The docs and tests are also copied from HashMap/HashSet.
The new methods are unstable, behind the `btree_retain` feature gate, with tracking issue #79025. See also rust-lang/rfcs#1338.
|
|
|