<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/alloc/tests/thin_box.rs, branch 1.78.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.78.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.78.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-08-21T11:46:03+00:00</updated>
<entry>
<title>Make use of `pointer::is_aligned[_to]`</title>
<updated>2022-08-21T11:46:03+00:00</updated>
<author>
<name>Maybe Waffle</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2022-08-19T09:26:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=efef211876b193ebc5e33dc9414c5a3dc14e9739'/>
<id>urn:sha1:efef211876b193ebc5e33dc9414c5a3dc14e9739</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Make `ThinBox&lt;T&gt;` covariant in `T`</title>
<updated>2022-06-27T17:05:55+00:00</updated>
<author>
<name>Josh Stone</name>
<email>jistone@redhat.com</email>
</author>
<published>2022-06-27T17:05:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e67e1655854b8f2c94dff80f4da2e595bd1ceaa8'/>
<id>urn:sha1:e67e1655854b8f2c94dff80f4da2e595bd1ceaa8</id>
<content type='text'>
Just like `Box&lt;T&gt;`, we want `ThinBox&lt;T&gt;` to be covariant in `T`, but the
projection in `WithHeader&lt;&lt;T as Pointee&gt;::Metadata&gt;` was making it
invariant. This is now hidden as `WithOpaqueHeader`, which we type-cast
whenever the real `WithHeader&lt;H&gt;` type is needed.
</content>
</entry>
<entry>
<title>Avoid zero-sized allocs in ThinBox if T and H are both ZSTs.</title>
<updated>2022-05-28T05:12:20+00:00</updated>
<author>
<name>Thom Chiovoloni</name>
<email>chiovolonit@gmail.com</email>
</author>
<published>2022-05-02T08:45:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=fc109bb6c68f59903dace87c69bdeb2df5a006f0'/>
<id>urn:sha1:fc109bb6c68f59903dace87c69bdeb2df5a006f0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>thin_box test: import from std, not alloc</title>
<updated>2022-04-11T02:59:51+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2022-04-11T02:59:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dbc0afa215a9b5de875d2d88d3b03e855e8d2681'/>
<id>urn:sha1:dbc0afa215a9b5de875d2d88d3b03e855e8d2681</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add ThinBox type for 1 stack pointer sized heap allocated trait objects</title>
<updated>2022-04-08T16:00:16+00:00</updated>
<author>
<name>Jane Lusby</name>
<email>jlusby@yaah.dev</email>
</author>
<published>2021-10-19T22:23:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a87a0d089e793903844ef40851deae48c039f8bb'/>
<id>urn:sha1:a87a0d089e793903844ef40851deae48c039f8bb</id>
<content type='text'>
Relevant commit messages from squashed history in order:

Add initial version of ThinBox

update test to actually capture failure

swap to middle ptr impl based on matthieu-m's design

Fix stack overflow in debug impl

The previous version would take a `&amp;ThinBox&lt;T&gt;` and deref it once, which
resulted in a no-op and the same type, which it would then print causing
an endless recursion. I've switched to calling `deref` by name to let
method resolution handle deref the correct number of times.

I've also updated the Drop impl for good measure since it seemed like it
could be falling prey to the same bug, and I'll be adding some tests to
verify that the drop is happening correctly.

add test to verify drop is behaving

add doc examples and remove unnecessary Pointee bounds

ThinBox: use NonNull

ThinBox: tests for size

Apply suggestions from code review

Co-authored-by: Alphyr &lt;47725341+a1phyr@users.noreply.github.com&gt;

use handle_alloc_error and fix drop signature

update niche and size tests

add cfg for allocating APIs

check null before calculating offset

add test for zst and trial usage

prevent optimizer induced ub in drop and cleanup metadata gathering

account for arbitrary size and alignment metadata

Thank you nika and thomcc!

Update library/alloc/src/boxed/thin.rs

Co-authored-by: Josh Triplett &lt;josh@joshtriplett.org&gt;

Update library/alloc/src/boxed/thin.rs

Co-authored-by: Josh Triplett &lt;josh@joshtriplett.org&gt;
</content>
</entry>
</feed>
