<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/rust/pin-init/examples, branch stable</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/rust/pin-init/examples?h=stable</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/rust/pin-init/examples?h=stable'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2026-10-11T10:06:47Z</updated>
<entry>
<title>rust: pin-init: internal: pin_data: complete invariant borrow support</title>
<updated>2026-10-11T10:06:47Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-05-02T21:40:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=e55acb73379fc2a5164c741bb1257becd346bc39'/>
<id>urn:sha1:e55acb73379fc2a5164c741bb1257becd346bc39</id>
<content type='text'>
Non-covariant types can already be accessed inside projections. As
projections are only generated for `Pin&lt;&amp;mut T&gt;`, they're not accessible
otherwise. Add `with_{field_name}` methods so fields can be accessed using
closures with just `&amp;T`.

Acked-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://patch.msgid.link/20261008-dev-selfref-v2-17-e280b3c8fba5@garyguo.net/
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: internal: pin_data: support mutable borrows</title>
<updated>2026-10-11T10:06:47Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-05-06T17:12:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=0b326dd96e773ef5e980f62f5e1b4fb05c4f983a'/>
<id>urn:sha1:0b326dd96e773ef5e980f62f5e1b4fb05c4f983a</id>
<content type='text'>
Allow fields to be mutably referenced by other fields in addition to shared
references. In order for this to be sound, the fields that can be mutably
borrowed are blocked from being accessed via field access syntax or
projection to maintain the aliasing requirements.

Acked-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://patch.msgid.link/20261008-dev-selfref-v2-14-e280b3c8fba5@garyguo.net/
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: internal: pin_data: enable self-referential support</title>
<updated>2026-10-11T10:06:47Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-09-29T12:58:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=8f6607d1e51d082f3eabf82adf62e0c732e1a5d6'/>
<id>urn:sha1:8f6607d1e51d082f3eabf82adf62e0c732e1a5d6</id>
<content type='text'>
Enable self-referential support, and add example and test cases.

Acked-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://patch.msgid.link/20261008-dev-selfref-v2-11-e280b3c8fba5@garyguo.net/
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add `raw_init` and `raw_try_init` and recommend over `__init`</title>
<updated>2026-08-05T10:36:16Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-07-29T15:38:45Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d5492db2bf30b7e617e41d4fe3dba22475a1a354'/>
<id>urn:sha1:d5492db2bf30b7e617e41d4fe3dba22475a1a354</id>
<content type='text'>
The `__init` method is not designed to be a public API (existence of "__"
is a hint for this); but currently there is no other API that allows raw
initialization on pointers. Add `raw_init` and `raw_try_init` and recommend
people to use this instead if raw pointer initialization is needed.

Link: https://patch.msgid.link/20260729-merge-init-v2-3-26adf47109e7@garyguo.net
[ Renamed from `ptr_[try_]init` to `raw_[try_]init`. - Gary ]
Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: merge `__pinned_init` and `__init`</title>
<updated>2026-08-03T12:36:42Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-07-29T15:38:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=91665820d9bf511e0c3fdf3edb464ba23130dafe'/>
<id>urn:sha1:91665820d9bf511e0c3fdf3edb464ba23130dafe</id>
<content type='text'>
These functions have the same requirements and are also required to execute
the same code. Prevent duplication by merging them to the single function
and document the additional relaxation of `Init::__init` on both the merged
function and the safety requirement of `Init`.

The existing `__pinned_init` function is deprecated and kept for
compatibility for existing users. For `cfg(kernel)`, it is soft-deprecated
for now and will be removed when all users are migrated.

Link: https://patch.msgid.link/20260729-merge-init-v2-2-26adf47109e7@garyguo.net
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: examples: use `Wrapper::pin_init` instead of manual reimplementation</title>
<updated>2026-08-03T12:36:34Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-07-29T15:38:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c998b661b7c024dfd6dd893927506e32ee8a42c5'/>
<id>urn:sha1:c998b661b7c024dfd6dd893927506e32ee8a42c5</id>
<content type='text'>
`UnsafeCell` gains the method via the extension trait `Wrapper`.

Link: https://patch.msgid.link/20260729-merge-init-v2-1-26adf47109e7@garyguo.net
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: examples: fix incorrect drop</title>
<updated>2026-07-13T11:09:41Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-07-10T16:20:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=554d1afffc391f938ca58ab74b82238ac2d29c37'/>
<id>urn:sha1:554d1afffc391f938ca58ab74b82238ac2d29c37</id>
<content type='text'>
Remove the drop and associated clippy allow. The warning reported by Clippy
here is genuine; the binding created is `Pin&lt;&amp;mut T&gt;` so dropping it does
nothing. `stack_pin_init` created bindings are only dropped at the end of
scope.

Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://patch.msgid.link/20260710-pin-init-sync-v1-2-8fa16cde87ae@garyguo.net
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: examples: fix `useless_borrows_in_formatting` clippy warning</title>
<updated>2026-05-10T22:00:51Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-05-05T11:51:37Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=430654211d566f86e8ee533ff1b01a42be6b602c'/>
<id>urn:sha1:430654211d566f86e8ee533ff1b01a42be6b602c</id>
<content type='text'>
Clippy 1.97 introduces new `useless_borrows_in_formatting` warning which
fires on the examples as we have `&amp;*expr` where the format macro takes
reference already. Remove the extra borrow.

Link: https://patch.msgid.link/20260505115138.2466966-1-gary@kernel.org
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: bump minimum Rust version to 1.82</title>
<updated>2026-05-10T21:58:33Z</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-04-28T13:10:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=531fdc2c341bded76817cef935c5fe97d88d643b'/>
<id>urn:sha1:531fdc2c341bded76817cef935c5fe97d88d643b</id>
<content type='text'>
Following the kernel minimum version bump in commit f32fb9c58a5b ("rust:
bump Rust minimum supported version to 1.85.0 (Debian Trixie)"), bump
pin-init's minimum Rust version to 1.82.

This removes the `lint_reasons` feature which is stabilized in 1.81 and the
`raw_ref_ops` and `new_uninit` features which are stabilized in 1.82.

Given we do not use any features that are stabilized in 1.82..=1.85 range,
and pin-init crate is useful for other projects which may have their own
MSRV requirements, the minimum version is not straightly bumped to 1.85.

Reviewed-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://patch.msgid.link/20260428-pin-init-sync-v1-2-07f9bd3859fb@garyguo.net
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: examples: mark as `#[inline]` all `From::from()`s for `Error`</title>
<updated>2026-05-10T21:58:33Z</updated>
<author>
<name>Alistair Francis</name>
<email>alistair.francis@wdc.com</email>
</author>
<published>2026-04-28T13:10:50Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=be7ea321a2d3a3d4151c9304f50fa1fe26487a81'/>
<id>urn:sha1:be7ea321a2d3a3d4151c9304f50fa1fe26487a81</id>
<content type='text'>
There was a recent request in kernel [1] to mark as `#[inline]` the
simple `From::from()` functions implemented for `Error`.

Thus mark all of the existing

    impl From&lt;...&gt; for Error {
        fn from(err: ...) -&gt; Self {
            ...
        }
    }

functions as `#[inline]`.

While in pin-init crate the relevant code is just examples, it
nevertheless does not hurt to use good practice for them.

Suggested-by: Gary Guo &lt;gary@garyguo.net&gt;
Link: https://lore.kernel.org/all/8403c8b7a832b5274743816eb77abfa4@garyguo.net/ [1]
Signed-off-by: Alistair Francis &lt;alistair.francis@wdc.com&gt;
Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;
[ Reworded commit message - Gary ]
Link: https://patch.msgid.link/20260428-pin-init-sync-v1-1-07f9bd3859fb@garyguo.net
Signed-off-by: Gary Guo &lt;gary@garyguo.net&gt;
</content>
</entry>
</feed>
