<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/src/collections/vec_deque/spec_extend.rs, branch 1.85.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.85.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.85.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-09-19T22:20:10+00:00</updated>
<entry>
<title>Add `#[track_caller]` to allocating methods of `Vec` &amp; `VecDeque`</title>
<updated>2024-09-19T22:20:10+00:00</updated>
<author>
<name>Pavel Grigorenko</name>
<email>GrigorenkoPV@ya.ru</email>
</author>
<published>2024-06-16T17:03:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0d4259e68e5211b99dea028c1b9071362e7f3b6f'/>
<id>urn:sha1:0d4259e68e5211b99dea028c1b9071362e7f3b6f</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>Don't use `Take` in `SpecExtend` impl</title>
<updated>2022-11-25T23:44:24+00:00</updated>
<author>
<name>Markus Everling</name>
<email>markuseverling@gmail.com</email>
</author>
<published>2022-11-25T13:47:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f6f25983c623e7a503df3afc643b846905a37412'/>
<id>urn:sha1:f6f25983c623e7a503df3afc643b846905a37412</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Changes according to code review</title>
<updated>2022-11-25T02:39:59+00:00</updated>
<author>
<name>Markus Everling</name>
<email>markuseverling@gmail.com</email>
</author>
<published>2022-11-25T02:36:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ecca8c532850a2cce403264bd3c85961a38c8308'/>
<id>urn:sha1:ecca8c532850a2cce403264bd3c85961a38c8308</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update VecDeque implementation</title>
<updated>2022-11-20T14:21:16+00:00</updated>
<author>
<name>Markus Everling</name>
<email>markuseverling@gmail.com</email>
</author>
<published>2022-10-12T22:58:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a1bf25e2bdbebad2f1f42118ba1d2c4a7ae4f7b0'/>
<id>urn:sha1:a1bf25e2bdbebad2f1f42118ba1d2c4a7ae4f7b0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Expose iter::ByRefSized as unstable feature and use it</title>
<updated>2022-06-17T22:03:54+00:00</updated>
<author>
<name>Paolo Barbolini</name>
<email>paolo.barbolini@m4ss.net</email>
</author>
<published>2022-06-11T22:55:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ce3b6f505ed8c0a285461f4f9b729b62e7703354'/>
<id>urn:sha1:ce3b6f505ed8c0a285461f4f9b729b62e7703354</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add VecDeque::extend from TrustedLen specialization</title>
<updated>2022-06-17T22:03:54+00:00</updated>
<author>
<name>Paolo Barbolini</name>
<email>paolo.barbolini@m4ss.net</email>
</author>
<published>2022-06-11T22:54:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bc3fae4dc1891de19368622d7b77ba3006b8f4ea'/>
<id>urn:sha1:bc3fae4dc1891de19368622d7b77ba3006b8f4ea</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add VecDeque::extend from vec::IntoIter and slice::Iter specializations</title>
<updated>2022-04-28T04:13:54+00:00</updated>
<author>
<name>Paolo Barbolini</name>
<email>paolo@paolo565.org</email>
</author>
<published>2022-04-10T22:00:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c126f7fc8bf9e2abc0cac1fae40d04f4cf21e4d0'/>
<id>urn:sha1:c126f7fc8bf9e2abc0cac1fae40d04f4cf21e4d0</id>
<content type='text'>
</content>
</entry>
</feed>
