<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/src/collections, branch 1.68.2</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.68.2</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.68.2'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-03-03T17:32:47+00:00</updated>
<entry>
<title>Use checked_add in VecDeque::append for ZSTs to avoid overflow</title>
<updated>2023-03-03T17:32:47+00:00</updated>
<author>
<name>pommicket</name>
<email>pommicket@gmail.com</email>
</author>
<published>2023-02-25T16:05:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=07a804307991dc96613fbf208e91f0ae3cdf318b'/>
<id>urn:sha1:07a804307991dc96613fbf208e91f0ae3cdf318b</id>
<content type='text'>
(cherry picked from commit 379b18bb0ab07e8f7ba04ca29ba52a1817cec1ce)
</content>
</entry>
<entry>
<title>Disambiguate comments</title>
<updated>2023-03-03T17:32:47+00:00</updated>
<author>
<name>Markus Everling</name>
<email>markuseverling@gmail.com</email>
</author>
<published>2023-02-26T01:33:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2d33fe73f4fbd928346cd118eb9405361f8ca64a'/>
<id>urn:sha1:2d33fe73f4fbd928346cd118eb9405361f8ca64a</id>
<content type='text'>
(cherry picked from commit 4a4f43e4e9b994c729a0506d921fe9734673a20a)
</content>
</entry>
<entry>
<title>Fix `VecDeque::shrink_to` and add tests.</title>
<updated>2023-03-03T17:32:47+00:00</updated>
<author>
<name>Markus Everling</name>
<email>markuseverling@gmail.com</email>
</author>
<published>2023-02-26T00:27:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a07453adef66a59b2e3a76d91fae2680cd5d8a5d'/>
<id>urn:sha1:a07453adef66a59b2e3a76d91fae2680cd5d8a5d</id>
<content type='text'>
This adds both a test specific to #108453 as well as an exhaustive test
that goes through all possible combinations of head index, length and target capacity
for a deque with capacity 16.

(cherry picked from commit 9e22516877a2853c71456ef792fcbd9087fb905a)
</content>
</entry>
<entry>
<title>Set version placeholders to 1.68</title>
<updated>2023-01-24T13:40:09+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2023-01-24T13:40:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b01e890d9384c55e2768c786c7dce2616255af48'/>
<id>urn:sha1:b01e890d9384c55e2768c786c7dce2616255af48</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Document guarantees about BinaryHeap invariant</title>
<updated>2023-01-14T21:28:30+00:00</updated>
<author>
<name>David Tolnay</name>
<email>dtolnay@gmail.com</email>
</author>
<published>2023-01-05T08:04:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=23501703fb444a083155e8aa0b280d36be84c676'/>
<id>urn:sha1:23501703fb444a083155e8aa0b280d36be84c676</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Leak amplification for peek_mut() to ensure BinaryHeap's invariant is always met</title>
<updated>2023-01-14T21:28:22+00:00</updated>
<author>
<name>David Tolnay</name>
<email>dtolnay@gmail.com</email>
</author>
<published>2022-12-18T17:40:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=aedb756020dffd4be1b4e055e989e8761103f93f'/>
<id>urn:sha1:aedb756020dffd4be1b4e055e989e8761103f93f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add test of leaking a binary_heap PeekMut</title>
<updated>2023-01-14T21:28:14+00:00</updated>
<author>
<name>David Tolnay</name>
<email>dtolnay@gmail.com</email>
</author>
<published>2022-12-18T17:40:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4fe167f83a90f3f193c3cb5dafb4c2862d0671e9'/>
<id>urn:sha1:4fe167f83a90f3f193c3cb5dafb4c2862d0671e9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mv binary_heap.rs binary_heap/mod.rs</title>
<updated>2023-01-10T18:01:39+00:00</updated>
<author>
<name>Alan Egerton</name>
<email>eggyal@gmail.com</email>
</author>
<published>2023-01-10T18:01:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1a87ed9a45c6e979b07cc3b30e89850763d3c0a0'/>
<id>urn:sha1:1a87ed9a45c6e979b07cc3b30e89850763d3c0a0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #106562 - clubby789:vec-deque-example, r=Mark-Simulacrum</title>
<updated>2023-01-08T08:01:48+00:00</updated>
<author>
<name>Yuki Okushi</name>
<email>huyuumi.dev+love@gmail.com</email>
</author>
<published>2023-01-08T08:01:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=14ce60333d918f7ed86174379791da681cbf408c'/>
<id>urn:sha1:14ce60333d918f7ed86174379791da681cbf408c</id>
<content type='text'>
Clarify examples for `VecDeque::get/get_mut`

Closes #106114

``@rustbot`` label +A-docs
</content>
</entry>
<entry>
<title>Auto merge of #104658 - thomcc:rand-update-and-usable-no_std, r=Mark-Simulacrum</title>
<updated>2023-01-08T01:34:05+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-01-08T01:34:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2afe58571e53d48a1fc2354271abe5aff60c5c44'/>
<id>urn:sha1:2afe58571e53d48a1fc2354271abe5aff60c5c44</id>
<content type='text'>
Update `rand` in the stdlib tests, and remove the `getrandom` feature from it.

The main goal is actually removing `getrandom`, so that eventually we can allow running the stdlib test suite on tier3 targets which don't have `getrandom` support. Currently those targets can only run the subset of stdlib tests that exist in uitests, and (generally speaking), we prefer not to test libstd functionality in uitests, which came up recently in https://github.com/rust-lang/rust/pull/104095 and https://github.com/rust-lang/rust/pull/104185. Additionally, the fact that we can't update `rand`/`getrandom` means we're stuck with the old set of tier3 targets, so can't test new ones.

~~Anyway, I haven't checked that this actually does allow use on tier3 targets (I think it does not, as some work is needed in stdlib submodules) but it moves us slightly closer to this, and seems to allow at least finally updating our `rand` dep, which definitely improves the status quo.~~ Checked and works now.

For the most part, our tests and benchmarks are fine using hard-coded seeds. A couple tests seem to fail with this (stuff manipulating the environment expecting no collisions, for example), or become pointless (all inputs to a function become equivalent). In these cases I've done a (gross) dance (ab)using `RandomState` and `Location::caller()` for some extra "entropy".

Trying to share that code seems *way* more painful than it's worth given that the duplication is a 7-line function, even if the lines are quite gross. (Keeping in mind that sharing it would require adding `rand` as a non-dev dep to std, and exposing a type from it publicly, all of which sounds truly awful, even if done behind a perma-unstable feature).

See also some previous attempts:
- https://github.com/rust-lang/rust/pull/86963 (in particular https://github.com/rust-lang/rust/pull/86963#issuecomment-885438936 which explains why this is non-trivial)
- https://github.com/rust-lang/rust/pull/89131
- https://github.com/rust-lang/rust/pull/96626#issuecomment-1114562857 (I tried in that PR at the same time, but settled for just removing the usage of `thread_rng()` from the benchmarks, since that was the main goal).
- https://github.com/rust-lang/rust/pull/104185
- Probably more. It's very tempting of a thing to "just update".

r? `@Mark-Simulacrum`
</content>
</entry>
</feed>
