<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/src/vec, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-28T03:23:45+00:00</updated>
<entry>
<title>Auto merge of #147042 - Noratrieb:untrack-caller-vec, r=tgross35</title>
<updated>2025-09-28T03:23:45+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2025-09-28T03:23:45+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c7f6aa2869acdbf014d094c6e427e554e160b6db'/>
<id>urn:sha1:c7f6aa2869acdbf014d094c6e427e554e160b6db</id>
<content type='text'>
Remove most `#[track_caller]` from allocating Vec methods

They cause significant binary size overhead while contributing little value.

closes rust-lang/rust#146963, see that issue for more details.
</content>
</entry>
<entry>
<title>Remove most `#[track_caller]` from allocating Vec methods</title>
<updated>2025-09-25T18:52:03+00:00</updated>
<author>
<name>Noratrieb</name>
<email>48135649+Noratrieb@users.noreply.github.com</email>
</author>
<published>2025-09-25T18:36:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9316d4508c42d5e6d91480aec34f66462801ee5d'/>
<id>urn:sha1:9316d4508c42d5e6d91480aec34f66462801ee5d</id>
<content type='text'>
They cause significant binary size overhead while contributing little
value.

Also removes them from the wrapping String methods that do not panic.
</content>
</entry>
<entry>
<title>Rollup merge of #146293 - BenjaminBrienen:try_remove, r=joboet</title>
<updated>2025-09-25T16:15:09+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-25T16:15:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fea9196e5271a61dc526246a6ccdc2db0f998603'/>
<id>urn:sha1:fea9196e5271a61dc526246a6ccdc2db0f998603</id>
<content type='text'>
feat: non-panicking `Vec::try_remove`

`if index &lt; my_vector.len() { Some(my_vector.remove(index)) } else { None }` is annoying to write and non-panicking functions are broadly useful.

APC: https://github.com/rust-lang/libs-team/issues/649

Tracking issue: https://github.com/rust-lang/rust/issues/146954
</content>
</entry>
<entry>
<title>Rollup merge of #141032 - petrosagg:extract-if-ub, r=joboet</title>
<updated>2025-09-25T16:15:07+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-09-25T16:15:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e3f762673241c2892951be3477b99753b68e41e1'/>
<id>urn:sha1:e3f762673241c2892951be3477b99753b68e41e1</id>
<content type='text'>
avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`

The implementation of the `Vec::extract_if` iterator violates the safety contract adverized by `slice::from_raw_parts` by always constructing a mutable slice for the entire length of the vector even though that span of memory can contain holes from items already drained. The safety contract of `slice::from_raw_parts` requires that all elements must be properly
initialized.

As an example we can look at the following code:

```rust
let mut v = vec![Box::new(0u64), Box::new(1u64)];
for item in v.extract_if(.., |x| **x == 0) {
    drop(item);
}
```

In the second iteration a `&amp;mut [Box&lt;u64&gt;]` slice of length 2 will be constructed. The first slot of the slice contains the bitpattern of an already deallocated box, which is invalid.

This fixes the issue by only creating references to valid items and using pointer manipulation for the rest. I have also taken the liberty to remove the big `unsafe` blocks in place of targetted ones with a SAFETY comment. The approach closely mirrors the implementation of `Vec::retain_mut`.

**Note to reviewers:** The diff is easier to follow with whitespace hidden.
</content>
</entry>
<entry>
<title>feature: Implement vec_try_remove</title>
<updated>2025-09-24T13:29:09+00:00</updated>
<author>
<name>BenjaminBrienen</name>
<email>Benjamin.Brienen@outlook.com</email>
</author>
<published>2025-09-24T12:25:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=56734495e2fd485a7be1ba77da1bf18a0eca4636'/>
<id>urn:sha1:56734495e2fd485a7be1ba77da1bf18a0eca4636</id>
<content type='text'>
Vec::try_remove is a non-panicking version of Vec::remove
</content>
</entry>
<entry>
<title>avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`</title>
<updated>2025-09-22T07:59:52+00:00</updated>
<author>
<name>Petros Angelatos</name>
<email>petrosagg@gmail.com</email>
</author>
<published>2025-05-15T12:46:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e9b2c4f395673399b0445733c7e8d3955e42ff0c'/>
<id>urn:sha1:e9b2c4f395673399b0445733c7e8d3955e42ff0c</id>
<content type='text'>
The implementation of the `Vec::extract_if` iterator violates the safety
contract adverized by `slice::from_raw_parts` by always constructing a
mutable slice for the entire length of the vector even though that span
of memory can contain holes from items already drained. The safety
contract of `slice::from_raw_parts` requires that all elements must be
properly initialized.

As an example we can look at the following code:

```rust
let mut v = vec![Box::new(0u64), Box::new(1u64)];
for item in v.extract_if(.., |x| **x == 0) {
    drop(item);
}
```

In the second iteration a `&amp;mut [Box&lt;u64&gt;]` slice of length 2 will be
constructed. The first slot of the slice contains the bitpattern of an
already deallocated box, which is invalid.

This fixes the issue by only creating references to valid items and
using pointer manipulation for the rest. I have also taken the liberty
to remove the big `unsafe` blocks in place of targetted ones with a
SAFETY comment. The approach closely mirrors the implementation of
`Vec::retain_mut`.

Signed-off-by: Petros Angelatos &lt;petrosagg@gmail.com&gt;
</content>
</entry>
<entry>
<title>Change the cfg to a dash</title>
<updated>2025-09-21T17:12:20+00:00</updated>
<author>
<name>Ben Kimock</name>
<email>kimockb@gmail.com</email>
</author>
<published>2025-09-18T14:48:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=df58fd8cf7710f7516c541769a141f0235978dab'/>
<id>urn:sha1:df58fd8cf7710f7516c541769a141f0235978dab</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add panic=immediate-abort</title>
<updated>2025-09-21T17:12:18+00:00</updated>
<author>
<name>Ben Kimock</name>
<email>kimockb@gmail.com</email>
</author>
<published>2025-09-07T16:31:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=888679013d1f424adef06267f3630069b4cabd40'/>
<id>urn:sha1:888679013d1f424adef06267f3630069b4cabd40</id>
<content type='text'>
</content>
</entry>
<entry>
<title>docs: improve doc of some methods w/ ranges</title>
<updated>2025-09-20T10:17:56+00:00</updated>
<author>
<name>tk</name>
<email>49250442+tkr-sh@users.noreply.github.com</email>
</author>
<published>2025-05-13T22:54:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ac3c480388d27ee9ebeb23d308bd37289d37bc41'/>
<id>urn:sha1:ac3c480388d27ee9ebeb23d308bd37289d37bc41</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Plumb Allocator generic into `std::vec::PeekMut`</title>
<updated>2025-09-19T00:29:23+00:00</updated>
<author>
<name>Sidney Cammeresi</name>
<email>sac@cheesecake.org</email>
</author>
<published>2025-09-14T18:14:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=934ee043feb6601f9dfb5be173a190a921e6d9a9'/>
<id>urn:sha1:934ee043feb6601f9dfb5be173a190a921e6d9a9</id>
<content type='text'>
</content>
</entry>
</feed>
