<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/rust/pin-init/src/alloc.rs, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-04-08T19:12:58+00:00</updated>
<entry>
<title>rust: pin-init: alloc: restrict `impl ZeroableOption` for `Box` to `T: Sized`</title>
<updated>2025-04-08T19:12:58+00:00</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2025-04-07T20:18:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3c75fff196c35c3bbe8c212ad03db94994130b32'/>
<id>urn:sha1:3c75fff196c35c3bbe8c212ad03db94994130b32</id>
<content type='text'>
Similar to what was done for `Zeroable&lt;NonNull&lt;T&gt;&gt;` in commit
df27cef15360 ("rust: init: fix `Zeroable` implementation for
`Option&lt;NonNull&lt;T&gt;&gt;` and `Option&lt;KBox&lt;T&gt;&gt;`"), the latest Rust
documentation [1] says it guarantees that `transmute::&lt;_,
Option&lt;T&gt;&gt;([0u8; size_of::&lt;T&gt;()])` is sound and produces
`Option::&lt;T&gt;::None` only in some cases. In particular, it says:

    `Box&lt;U&gt;` (specifically, only `Box&lt;U, Global&gt;`) when `U: Sized`

Thus restrict the `impl` to `Sized`, and use similar wording as in that
commit too.

Link: https://doc.rust-lang.org/stable/std/option/index.html#representation [1]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Link: https://github.com/Rust-for-Linux/pin-init/pull/32/commits/a6007cf555e5946bcbfafe93a6468c329078acd8
Fixes: 9b2299af3b92 ("rust: pin-init: add `std` and `alloc` support from the user-space version")
Cc: stable@vger.kernel.org
[ Adjust mentioned commit to the one from the kernel. - Benno ]
Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Link: https://lore.kernel.org/r/20250407201755.649153-2-benno.lossin@proton.me
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add `std` and `alloc` support from the user-space version</title>
<updated>2025-03-16T20:59:19+00:00</updated>
<author>
<name>Benno Lossin</name>
<email>benno.lossin@proton.me</email>
</author>
<published>2025-03-08T11:05:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9b2299af3b92eb5b2c2f87965a5fa24a93e90d06'/>
<id>urn:sha1:9b2299af3b92eb5b2c2f87965a5fa24a93e90d06</id>
<content type='text'>
To synchronize the kernel's version of pin-init with the user-space
version, introduce support for `std` and `alloc`. While the kernel uses
neither, the user-space version has to support both. Thus include the
required `#[cfg]`s and additional code.

Signed-off-by: Benno Lossin &lt;benno.lossin@proton.me&gt;
Reviewed-by: Fiona Behrens &lt;me@kloenk.dev&gt;
Tested-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Link: https://lore.kernel.org/r/20250308110339.2997091-17-benno.lossin@proton.me
[ Undo the temporary `--extern force:alloc` since now we have contents
  for `alloc` here. - Miguel ]
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
</feed>
