<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/src/collections/binary_heap.rs, branch 1.58.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.58.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.58.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2021-11-12T07:45:25+00:00</updated>
<entry>
<title>provide a `SpecExtend` trait for `Vec&lt;T&gt;`</title>
<updated>2021-11-12T07:45:25+00:00</updated>
<author>
<name>Neutron3529</name>
<email>qweytr_1@163.com</email>
</author>
<published>2021-08-24T06:41:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2feee3659e19fddf2eb47ea37293cae73bd52c98'/>
<id>urn:sha1:2feee3659e19fddf2eb47ea37293cae73bd52c98</id>
<content type='text'>
The discussion is [here](https://internals.rust-lang.org/t/append-vec-to-binaryheap/15209/3)
</content>
</entry>
<entry>
<title>Rollup merge of #89786 - jkugelman:must-use-len-and-is_empty, r=joshtriplett</title>
<updated>2021-10-31T12:20:05+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2021-10-31T12:20:05+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=88e5ae2dd3cf4a0bbb5af69ef70e80d5dc7b462c'/>
<id>urn:sha1:88e5ae2dd3cf4a0bbb5af69ef70e80d5dc7b462c</id>
<content type='text'>
Add #[must_use] to len and is_empty

Parent issue: #89692

r? `@joshtriplett`
</content>
</entry>
<entry>
<title>Add #[must_use] to len and is_empty</title>
<updated>2021-10-30T23:25:12+00:00</updated>
<author>
<name>John Kugelman</name>
<email>john@kugelman.name</email>
</author>
<published>2021-10-11T20:15:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6745e8da06e1fd313d2ff20ff9fe8d8dc4714479'/>
<id>urn:sha1:6745e8da06e1fd313d2ff20ff9fe8d8dc4714479</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #89899 - jkugelman:must-use-alloc, r=joshtriplett</title>
<updated>2021-10-30T22:33:24+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2021-10-30T22:33:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1adb6643928dd3bacdd079f87f7f4cdacf510823'/>
<id>urn:sha1:1adb6643928dd3bacdd079f87f7f4cdacf510823</id>
<content type='text'>
Add #[must_use] to remaining alloc functions

I've run out of compelling reasons to group functions together across crates so I'm just going to go module-by-module. This is everything remaining from the `alloc` crate.

I ignored these because they might be used to purposefully leak memory... or other allocator shenanigans? I dunno. I'll add them if y'all tell me to.

```rust
alloc::alloc          unsafe fn alloc(layout: Layout) -&gt; *mut u8;
alloc::alloc          unsafe fn alloc_zeroed(layout: Layout) -&gt; *mut u8;
alloc::sync::Arc&lt;T&gt;   fn into_raw(this: Self) -&gt; *const T;
```

I don't know why clippy ignored these. I added them myself:

```rust
alloc::collections::btree_map::BTreeMap&lt;K, V&gt;   fn range&lt;T: ?Sized, R&gt;(&amp;self, range: R) -&gt; Range&lt;'_, K, V&gt;;
alloc::collections::btree_set::BTreeSet&lt;T&gt;      fn range&lt;K: ?Sized, R&gt;(&amp;self, range: R) -&gt; Range&lt;'_, T&gt;;
```

I added these non-mutating `mut` functions:

```rust
alloc::collections::btree_map::BTreeMap&lt;K, V&gt;     fn range_mut&lt;T: ?Sized, R&gt;(&amp;mut self, range: R) -&gt; RangeMut&lt;'_, K, V&gt;;
alloc::collections::btree_map::BTreeMap&lt;K, V&gt;     fn iter_mut(&amp;mut self) -&gt; IterMut&lt;'_, K, V&gt;;
alloc::collections::btree_map::BTreeMap&lt;K, V&gt;     fn values_mut(&amp;mut self) -&gt; ValuesMut&lt;'_, K, V&gt;;
alloc::collections::linked_list::LinkedList&lt;T&gt;    fn iter_mut(&amp;mut self) -&gt; IterMut&lt;'_, T&gt;;
alloc::collections::linked_list::LinkedList&lt;T&gt;    fn cursor_front_mut(&amp;mut self) -&gt; CursorMut&lt;'_, T&gt;;
alloc::collections::linked_list::LinkedList&lt;T&gt;    fn cursor_back_mut(&amp;mut self) -&gt; CursorMut&lt;'_, T&gt;;
alloc::collections::linked_list::LinkedList&lt;T&gt;    fn front_mut(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
alloc::collections::linked_list::LinkedList&lt;T&gt;    fn back_mut(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
alloc::collections::linked_list::CursorMut&lt;'a, T&gt; fn current(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
alloc::collections::linked_list::CursorMut&lt;'a, T&gt; fn peek_next(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
alloc::collections::linked_list::CursorMut&lt;'a, T&gt; fn peek_prev(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
alloc::collections::linked_list::CursorMut&lt;'a, T&gt; fn front_mut(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
alloc::collections::linked_list::CursorMut&lt;'a, T&gt; fn back_mut(&amp;mut self) -&gt; Option&lt;&amp;mut T&gt;;
```

I moved a few existing `#[must_use]`s from functions onto the iterator types they return: `IntoIterSorted`, `IntoKeys`, `IntoValues`.

Parent issue: #89692

r? `@joshtriplett`
</content>
</entry>
<entry>
<title>Clarify undefined behaviour for binary heap, btree and hashset</title>
<updated>2021-10-21T13:30:46+00:00</updated>
<author>
<name>Wilfred Hughes</name>
<email>me@wilfred.me.uk</email>
</author>
<published>2021-07-28T06:13:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=04c1ec51f1e2073c4df56f4239d08fb4522aa081'/>
<id>urn:sha1:04c1ec51f1e2073c4df56f4239d08fb4522aa081</id>
<content type='text'>
Previously, it wasn't clear whether "This could include" was referring
to logic errors, or undefined behaviour. Tweak wording to clarify this
sentence does not relate to UB.
</content>
</entry>
<entry>
<title>Add #[must_use] to remaining alloc functions</title>
<updated>2021-10-15T15:46:49+00:00</updated>
<author>
<name>John Kugelman</name>
<email>john@kugelman.name</email>
</author>
<published>2021-10-14T23:56:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fb2d0f5c03d2f699eb87bc1986386bdcf6a3f6eb'/>
<id>urn:sha1:fb2d0f5c03d2f699eb87bc1986386bdcf6a3f6eb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #89778 - jkugelman:must-use-as_type-conversions, r=joshtriplett</title>
<updated>2021-10-12T12:53:08+00:00</updated>
<author>
<name>the8472</name>
<email>the8472@users.noreply.github.com</email>
</author>
<published>2021-10-12T12:53:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b55a3c5d150b64fbd878109d9428ac8edc9cd68b'/>
<id>urn:sha1:b55a3c5d150b64fbd878109d9428ac8edc9cd68b</id>
<content type='text'>
Add #[must_use] to as_type conversions

Clippy missed these:

```rust
alloc::string::String   fn as_mut_str(&amp;mut self) -&gt; &amp;mut str;
core::mem::NonNull&lt;T&gt;   unsafe fn as_uninit_mut&lt;'a&gt;(&amp;mut self) -&gt; &amp;'a MaybeUninit&lt;T&gt;;
str                     unsafe fn as_bytes_mut(&amp;mut self) -&gt; &amp;mut [u8];
str                     fn as_mut_ptr(&amp;mut self) -&gt; *mut u8;
```

Parent issue: #89692

r? ````@joshtriplett````
</content>
</entry>
<entry>
<title>Add #[must_use] to as_type conversions</title>
<updated>2021-10-11T17:57:38+00:00</updated>
<author>
<name>John Kugelman</name>
<email>john@kugelman.name</email>
</author>
<published>2021-10-11T17:57:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=06e625f7d582601f5e2ff69ba80f6d3a11632b24'/>
<id>urn:sha1:06e625f7d582601f5e2ff69ba80f6d3a11632b24</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #89726 - jkugelman:must-use-alloc-constructors, r=joshtriplett</title>
<updated>2021-10-11T12:11:42+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2021-10-11T12:11:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d7c9693401e590cce78ea74d8576a124266025d6'/>
<id>urn:sha1:d7c9693401e590cce78ea74d8576a124266025d6</id>
<content type='text'>
Add #[must_use] to alloc constructors

Added `#[must_use]`. to the various forms of `new`, `pin`, and `with_capacity` in the `alloc` crate. No extra explanations given as I couldn't think of anything useful to add.

I figure this deserves extra scrutiny compared to the other PRs I've done so far. In particular:

* The 4 `pin`/`pin_in` methods I touched. Are there legitimate use cases for pinning and not using the result? Pinning's a difficult concept I'm not very comfortable with.
* `Box`'s constructors. Do people ever create boxes just for the side effects... allocating or zeroing out memory?

Parent issue: #89692

r? ``@joshtriplett``
</content>
</entry>
<entry>
<title>Add #[must_use] to conversions that move self</title>
<updated>2021-10-10T23:50:52+00:00</updated>
<author>
<name>John Kugelman</name>
<email>john@kugelman.name</email>
</author>
<published>2021-10-10T23:50:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b115781bcd0609e94c08192924853097c73f1a1c'/>
<id>urn:sha1:b115781bcd0609e94c08192924853097c73f1a1c</id>
<content type='text'>
</content>
</entry>
</feed>
