| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
BTreeMap: document a curious assumption in test cases
r? ```@Mark-Simulacrum```
|
|
fix various aliasing issues in the standard library
This fixes various cases where the standard library either used raw pointers after they were already invalidated by using the original reference again, or created raw pointers for one element of a slice and used it to access neighboring elements.
|
|
|
|
- BTreeMap::len
- BTreeMap::is_empty
- BTreeSet::len
- BTreeSet::is_empty
|
|
|
|
|
|
|
|
BTreeMap: move generic support functions out of navigate.rs
A preparatory step chipped off #78104, useful in general (if at all).
r? `@Mark-Simulacrum`
|
|
Support custom allocators in `Box`
r? `@Amanieu`
This pull request requires a crater run.
### Prior work:
- #71873
- #58457
- [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate
Currently blocked on:
- ~#77118~
- ~https://github.com/rust-lang/chalk/issues/615 (#77515)~
|
|
|
|
btree: merge the implementations of MergeIter
Also remove the gratuitous Copy bounds. Same benchmark performance.
r? `@Mark-Simulacrum`
|
|
|
|
|
|
|
|
BTreeMap: split off most code of remove and split_off
Putting map.rs on a diet, in addition to #77851.
r? @dtolnay
|
|
|
|
|
|
BTreeMap: test invariants more thoroughly and more readably
r? @Mark-Simulacrum
|
|
|
|
|
|
Move `slice::check_range` to `RangeBounds`
Since this method doesn't take a slice anymore (#76662), it makes more sense to define it on `RangeBounds`.
Questions:
- Should the new method be `assert_len` or `assert_length`?
|
|
|
|
BTreeMap: refactor Entry out of map.rs into its own file
btree/map.rs is approaching the 3000 line mark, splitting out the entry
code buys about 500 lines of headroom.
I've created this PR because the changes I've made in #77438 will push `map.rs` over the 3000 line limit and cause tidy to complain.
I picked `Entry` to factor out because it feels less tightly coupled to the rest of `BTreeMap` than the various iterator implementations.
Related: #60302
|
|
BTreeMap: improve gdb introspection of BTreeMap with ZST keys or values
I accidentally pushed an earlier revision in #77788: it changes the index of tuples for BTreeSet from ""[{}]".format(i) to "key{}".format(i). Which doesn't seem to make the slightest difference on my linux box nor on CI. In fact, gdb doesn't make any distinction between "key{}" and "val{}" for a BTreeMap either, leading to confusing output if you test more. But easy to improve.
r? @Mark-Simulacrum
|
|
liballoc: VecDeque: Add binary search functions
I am submitting rust-lang/rfcs#2997 as a PR as suggested by @scottmcm
I haven't yet created a tracking issue - if there's a favorable feedback I'll create one and update the issue links in the unstable attribs.
|
|
|
|
|
|
|
|
|
|
|
|
BTreeMap: type-specific variants of node_as_mut and cast_unchecked
Improves debug checking and shortens some expressions. Extracted from #77408
|
|
btree/map.rs is approaching the 3000 line mark, splitting out the entry
code buys about 500 lines of headroom
|
|
|
|
BTreeMap: comment why drain_filter's size_hint is somewhat pessimistic
The `size_hint` of the `DrainFilter` iterator doesn't adjust as you iterate. This hardly seems important to me, but there has been a comparable PR #64383 in the past. I guess a scenario is that you first iterate half the map manually and keep most of the key/value pairs in the map, and then tell the predicate to drain most of the key/value pairs and `.collect` the iterator over the remaining half of the map.
I am totally ambivalent whether this is better or not.
r? @Mark-Simulacrum
|
|
|
|
Remove `Box::leak_with_alloc`
Add leak-test for box with allocator
Rename `AllocErr` to `AllocError` in leak-test
Add `Box::alloc` and adjust examples to use the new API
|
|
|
|
|
|
|
|
references
|
|
|
|
Replace some once(x).chain(once(y)) with [x, y] IntoIter
Now that we have by-value array iterators that are [already used](https://github.com/rust-lang/rust/blob/25c8c53dd994acb3f4f7c02fe6bb46076393f8b0/compiler/rustc_hir/src/def.rs#L305-L307)...
For example,
```diff
- once(self.type_ns).chain(once(self.value_ns)).chain(once(self.macro_ns)).filter_map(|it| it)
+ IntoIter::new([self.type_ns, self.value_ns, self.macro_ns]).filter_map(|it| it)
```
|
|
BTreeMap: refactoring around edges, missed spots
Tweaks from #77244 (and more) that are really inconsistencies in #77005.
r? @Mark-Simulacrum
|
|
r=Mark-Simulacrum
BTreeMap: admit the existence of leaf edges in comments
The btree code is ambiguous about leaf edges (i.e., edges within leaf nodes). Iteration relies on them heavily, but some of the comments suggest there are no leaf edges (extracted from #77025)
r? @Mark-Simulacrum
|
|
BTreeMap: complete the compile-time test_variance test case
Some of the items added to the new `test_sync` belonged in the old `test_variance` as well. And fixed inconsistent paths to nearby modules.
r? @Mark-Simulacrum
|
|
BTreeMap: document DrainFilterInner better
r? @Mark-Simulacrum
|
|
Now that we have by-value array iterators...
|
|
|