<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/src/collections/vec_deque/mod.rs, branch 1.83.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.83.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.83.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-09-22T23:11:29+00:00</updated>
<entry>
<title>Reformat using the new identifier sorting from rustfmt</title>
<updated>2024-09-22T23:11:29+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2024-09-22T23:05:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c682aa162b0d41e21cc6748f4fecfe01efb69d1f'/>
<id>urn:sha1:c682aa162b0d41e21cc6748f4fecfe01efb69d1f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>[Clippy] Swap `manual_retain` to use diagnostic items instead of paths</title>
<updated>2024-09-18T16:20:44+00:00</updated>
<author>
<name>GnomedDev</name>
<email>david2005thomas@gmail.com</email>
</author>
<published>2024-09-18T15:59:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a18564c1987e9c6009884af09092b4c2cd2dbbe1'/>
<id>urn:sha1:a18564c1987e9c6009884af09092b4c2cd2dbbe1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add FIXME(const-hack)</title>
<updated>2024-09-08T21:08:40+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-09-08T14:35:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=332fa6aa6ed70e285c155d112a30027947cad12b'/>
<id>urn:sha1:332fa6aa6ed70e285c155d112a30027947cad12b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Reformat `use` declarations.</title>
<updated>2024-07-28T22:26:52+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2024-07-28T22:13:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=84ac80f1921afc243d71fd0caaa4f2838c294102'/>
<id>urn:sha1:84ac80f1921afc243d71fd0caaa4f2838c294102</id>
<content type='text'>
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
</content>
</entry>
<entry>
<title>Specialize `TrustedLen` for `Iterator::unzip()`</title>
<updated>2024-07-07T03:58:52+00:00</updated>
<author>
<name>Chayim Refael Friedman</name>
<email>chayimfr@gmail.com</email>
</author>
<published>2024-07-07T03:58:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=54556f49d368ba96a92fd6ec352cf6b12e9542ef'/>
<id>urn:sha1:54556f49d368ba96a92fd6ec352cf6b12e9542ef</id>
<content type='text'>
Don't check the capacity every time (and also for `Extend` for tuples, as this is how `unzip()` is implemented).

I did this with an unsafe method on `Extend` that doesn't check for growth (`extend_one_unchecked()`). I've marked it as perma-unstable currently, although we may want to expose it in the future so collections outside of std can benefit from it. Then specialize `Extend for (A, B)` for `TrustedLen` to call it.

It may seem that an alternative way of implementing this is to have a semi-public trait (`#[doc(hidden)]` public, so collections outside of core can implement it) for `extend()` inside tuples, and specialize it from collections. However, it is impossible due to limitations of `min_specialization`.

A concern that may arise with the current approach is that implementing `extend_one_unchecked()` correctly must also incur implementing `extend_reserve()`, otherwise you can have UB. This is a somewhat non-local safety invariant. However, I believe this is fine, since to have actual UB you must have unsafe code inside your `extend_one_unchecked()` that makes incorrect assumption, *and* not implement `extend_reserve()`. I've also documented this requirement.
</content>
</entry>
<entry>
<title>Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.</title>
<updated>2024-05-07T19:30:34+00:00</updated>
<author>
<name>Markus Everling</name>
<email>markuseverling@gmail.com</email>
</author>
<published>2024-04-11T15:31:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ffe8510e3d989f35163ac5406af82e1c9dd8f769'/>
<id>urn:sha1:ffe8510e3d989f35163ac5406af82e1c9dd8f769</id>
<content type='text'>
Luckily it's comparatively simple to just restore the `VecDeque` into a valid state on unwinds.
</content>
</entry>
<entry>
<title>Rollup merge of #122201 - coolreader18:doc-clone_from, r=dtolnay</title>
<updated>2024-04-17T16:01:37+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2024-04-17T16:01:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=21deaed4a1747bc336c902a7a85084f76c345917'/>
<id>urn:sha1:21deaed4a1747bc336c902a7a85084f76c345917</id>
<content type='text'>
Document overrides of `clone_from()` in core/std

As mentioned in https://github.com/rust-lang/rust/pull/96979#discussion_r1379502413

Specifically, when an override doesn't just forward to an inner type, document the behavior and that it's preferred over simply assigning a clone of source. Also, change instances where the second parameter is "other" to "source".

I reused some of the wording over and over for similar impls, but I'm not sure that the wording is actually *good*. Would appreciate feedback about that.

Also, now some of these seem to provide pretty specific guarantees about behavior (e.g. will reuse the exact same allocation iff the len is the same), but I was basing it off of the docs for [`Box::clone_from`](https://doc.rust-lang.org/1.75.0/std/boxed/struct.Box.html#method.clone_from-1) - I'm not sure if providing those strong guarantees is actually good or not.
</content>
</entry>
<entry>
<title>Address comments</title>
<updated>2024-04-17T05:18:04+00:00</updated>
<author>
<name>Noa</name>
<email>coolreader18@gmail.com</email>
</author>
<published>2024-04-17T05:18:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=87db7c32a70238785083b6de772cfd00e0adbc10'/>
<id>urn:sha1:87db7c32a70238785083b6de772cfd00e0adbc10</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add invariant to VecDeque::pop_* that len &lt; cap if pop successful</title>
<updated>2024-04-08T10:12:13+00:00</updated>
<author>
<name>Philippe-Cholet</name>
<email>44676486+Philippe-Cholet@users.noreply.github.com</email>
</author>
<published>2024-04-08T10:12:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7a2678de7d3c0caa169542bd56a4fbf41b73a5b5'/>
<id>urn:sha1:7a2678de7d3c0caa169542bd56a4fbf41b73a5b5</id>
<content type='text'>
Similar to #114370 for VecDeque instead of Vec. It now uses `core::hint::assert_unchecked`.
</content>
</entry>
<entry>
<title>Auto merge of #122945 - andy-k:sorted-vec-example, r=jhpratt</title>
<updated>2024-04-02T03:14:05+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2024-04-02T03:14:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6bbd8c519af69ebc30486d6cf02b7f7a52113950'/>
<id>urn:sha1:6bbd8c519af69ebc30486d6cf02b7f7a52113950</id>
<content type='text'>
improve example on inserting to a sorted vector to avoid shifting equal elements
</content>
</entry>
</feed>
