<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/rust/pin-init/src, branch v6.17</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.17</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.17'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-07-13T21:05:14Z</updated>
<entry>
<title>Merge tag 'pin-init-v6.17' of https://github.com/Rust-for-Linux/linux into rust-next</title>
<updated>2025-07-13T21:05:14Z</updated>
<author>
<name>Miguel Ojeda</name>
<email>ojeda@kernel.org</email>
</author>
<published>2025-07-13T21:05:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e8fa0481ea15ba1d40a836fa5dbfc1f49680fba8'/>
<id>urn:sha1:e8fa0481ea15ba1d40a836fa5dbfc1f49680fba8</id>
<content type='text'>
Pull pin-init updates from Benno Lossin:
 "Added:

   - 'impl&lt;T, E&gt; [Pin]Init&lt;T, E&gt; for Result&lt;T, E&gt;', so results are now
     (pin-)initializers.

   - 'Zeroable::init_zeroed()' delegating to 'init_zeroed()'.

   - New 'zeroed()', a safe version of 'mem::zeroed()' and also provide
     it via 'Zeroable::zeroed()'.

   - Implement 'Zeroable' for 'Option&lt;&amp;T&gt;' and 'Option&lt;&amp;mut T&gt;'.

   - Implement 'Zeroable' for 'Option&lt;[unsafe] [extern "abi"]
     fn(...args...) -&gt; ret&gt;' for '"Rust"' and '"C"' ABIs and up to 20
     arguments.

  Changed:

   - Blanket impls of 'Init' and 'PinInit' from 'impl&lt;T, E&gt;
     [Pin]Init&lt;T, E&gt; for T' to 'impl&lt;T&gt; [Pin]Init&lt;T&gt; for T'.

   - Renamed 'zeroed()' to 'init_zeroed()'.

  Upstream dev news:

   - More CI improvements to deny warnings, use '--all-targets'. Also
     check the synchronization status of the two '-next' branches in
     upstream and the kernel."

Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;

* tag 'pin-init-v6.17' of https://github.com/Rust-for-Linux/linux:
  rust: pin-init: examples, tests: use `ignore` instead of conditionally compiling tests
  rust: init: remove doctest's `Error::from_errno` workaround
  rust: init: re-enable doctests
  rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments
  rust: pin-init: change `impl Zeroable for Option&lt;NonNull&lt;T&gt;&gt;` to `ZeroableOption for NonNull&lt;T&gt;`
  rust: pin-init: implement `ZeroableOption` for `&amp;T` and `&amp;mut T`
  rust: pin-init: add `zeroed()` &amp; `Zeroable::zeroed()` functions
  rust: pin-init: add `Zeroable::init_zeroed`
  rust: pin-init: rename `zeroed` to `init_zeroed`
  rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature
  rust: pin-init: examples: pthread_mutex: disable the main test for miri
  rust: pin-init: examples, tests: add conditional compilation in order to compile under any feature combination
  rust: pin-init: change blanket impls for `[Pin]Init` and add one for `Result&lt;T, E&gt;`
  rust: pin-init: improve safety documentation for `impl&lt;T&gt; [Pin]Init&lt;T&gt; for T`
</content>
</entry>
<entry>
<title>rust: Use consistent "# Examples" heading style in rustdoc</title>
<updated>2025-06-23T23:02:30Z</updated>
<author>
<name>Viresh Kumar</name>
<email>viresh.kumar@linaro.org</email>
</author>
<published>2025-06-10T09:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b6985083be1deb1f5fa14d160265f57d9ccb42a1'/>
<id>urn:sha1:b6985083be1deb1f5fa14d160265f57d9ccb42a1</id>
<content type='text'>
Use a consistent `# Examples` heading in rustdoc across the codebase.

Some modules previously used `## Examples` (even when they should be
available as top-level headers), while others used `# Example`, which
deviates from the preferred `# Examples` style.

Suggested-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Signed-off-by: Viresh Kumar &lt;viresh.kumar@linaro.org&gt;
Acked-by: Benno Lossin &lt;lossin@kernel.org&gt;
Link: https://lore.kernel.org/r/ddd5ce0ac20c99a72a4f1e4322d3de3911056922.1749545815.git.viresh.kumar@linaro.org
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: implement `ZeroableOption` for function pointers with up to 20 arguments</title>
<updated>2025-06-11T19:13:57Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-23T14:51:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ec87ec35ca8bd61bfc1200224d332b4573b9dafa'/>
<id>urn:sha1:ec87ec35ca8bd61bfc1200224d332b4573b9dafa</id>
<content type='text'>
`Option&lt;[unsafe] [extern "abi"] fn(...args...) -&gt; ret&gt;` is documented
[1] to also have the `None` variant equal all zeroes.

Link: https://doc.rust-lang.org/stable/std/option/index.html#representation [1]
Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/b6c1ab4fb3699765f81ae512ecac5a2f032d8d51
Link: https://lore.kernel.org/all/20250523145125.523275-7-lossin@kernel.org
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: change `impl Zeroable for Option&lt;NonNull&lt;T&gt;&gt;` to `ZeroableOption for NonNull&lt;T&gt;`</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-23T14:51:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f473538706b9fb5e82c9864b04089d35e4f93d5'/>
<id>urn:sha1:9f473538706b9fb5e82c9864b04089d35e4f93d5</id>
<content type='text'>
This brings it in line with references. It too is listed in [1].

Link: https://doc.rust-lang.org/stable/std/option/index.html#representation
Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/8e52bf56ddc2190ce901d2f7c008ab8a64f653a9
Link: https://lore.kernel.org/all/20250523145125.523275-6-lossin@kernel.org
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: implement `ZeroableOption` for `&amp;T` and `&amp;mut T`</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-23T14:51:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e93a238605348bc40fed77ba5582e311376d113b'/>
<id>urn:sha1:e93a238605348bc40fed77ba5582e311376d113b</id>
<content type='text'>
`Option&lt;&amp;T&gt;` and `Option&lt;&amp;mut T&gt;` are documented [1] to have the `None`
variant be all zeroes.

Link: https://doc.rust-lang.org/stable/std/option/index.html#representation [1]
Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/5ef1638c79e019d3dc0c62db5905601644c2e60a
Link: https://lore.kernel.org/all/20250523145125.523275-5-lossin@kernel.org
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add `zeroed()` &amp; `Zeroable::zeroed()` functions</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-23T14:50:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d67b37012080cf1978b5fd36f040a53f92152243'/>
<id>urn:sha1:d67b37012080cf1978b5fd36f040a53f92152243</id>
<content type='text'>
`zeroed()` returns a zeroed out value of a sized type implementing
`Zeroable`.

The function is added as a free standing function, in addition to an
associated function on `Zeroable`, because then it can be marked `const`
(functions in traits can't be const at the moment).

Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/809e4ec160579c1601dce5d78b432a5b6c8e4e40
Link: https://lore.kernel.org/all/20250523145125.523275-4-lossin@kernel.org
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: add `Zeroable::init_zeroed`</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-23T14:50:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c47024ba198b01cab6bb6e3e5a69b73ed2f2aa16'/>
<id>urn:sha1:c47024ba198b01cab6bb6e3e5a69b73ed2f2aa16</id>
<content type='text'>
The trait function delegates to the already existing `init_zeroed`
function that returns a zeroing initializer for `Self`.

The syntax `..Zeroable::init_zeroed()` is already used by the
initialization macros to initialize all fields that are not mentioned in
the initializer with zero. Therefore it is expected that the function
also exists on the trait.

Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/a424a6c9af5a4418a8e5e986a3db26a4432e2f1a
Link: https://lore.kernel.org/all/20250523145125.523275-3-lossin@kernel.org
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: rename `zeroed` to `init_zeroed`</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-23T14:50:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=101b7cf006d4b4b98652bd15dc36e63ede8f8ad8'/>
<id>urn:sha1:101b7cf006d4b4b98652bd15dc36e63ede8f8ad8</id>
<content type='text'>
The name `zeroed` is a much better fit for a function that returns the
type by-value.

Link: https://github.com/Rust-for-Linux/pin-init/pull/56/commits/7dbe38682c9725405bab91dcabe9c4d8893d2f5e
[ also rename uses in `rust/kernel/init.rs` - Benno]
Link: https://lore.kernel.org/all/20250523145125.523275-2-lossin@kernel.org
[ Fix wrong replacement of `mem::zeroed` in the definition of `trait
  Zeroable`. - Benno ]
[ Also change occurrences of `zeroed` in `configfs.rs` - Benno ]
Acked-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: feature-gate the `stack_init_reuse` test on the `std` feature</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-06-09T14:17:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b3b4f760ccf2d08ff3db0f094c32ce70bba2eb15'/>
<id>urn:sha1:b3b4f760ccf2d08ff3db0f094c32ce70bba2eb15</id>
<content type='text'>
When trying to run `cargo check --all-targets --no-default-features`, an
error is reported by the test, as it cannot find the `std` crate. This
is to be expected, since the `--no-default-features` flag enables the
`no-std` behavior of the crate. Thus exclude the test in that scenario.

Link: https://github.com/Rust-for-Linux/pin-init/pull/50/commits/2813729ccacdedee9dbfcab1ed285b8721a0391b
Link: https://lore.kernel.org/all/20250523125424.192843-4-lossin@kernel.org
[ Changed my author email address to @kernel.org. - Benno ]
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
<entry>
<title>rust: pin-init: change blanket impls for `[Pin]Init` and add one for `Result&lt;T, E&gt;`</title>
<updated>2025-06-11T19:13:56Z</updated>
<author>
<name>Benno Lossin</name>
<email>lossin@kernel.org</email>
</author>
<published>2025-05-29T08:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e832374ccadf4d1ce7bd40a85b9320bd7fbb3628'/>
<id>urn:sha1:e832374ccadf4d1ce7bd40a85b9320bd7fbb3628</id>
<content type='text'>
Remove the error from the blanket implementations `impl&lt;T, E&gt; Init&lt;T, E&gt;
for T` (and also for `PinInit`). Add implementations for `Result&lt;T, E&gt;`.

This allows one to easily construct (un)conditional failing
initializers. It also improves the compatibility with APIs that do not
use pin-init, because users can supply a `Result&lt;T, E&gt;` to a  function
taking an `impl PinInit&lt;T, E&gt;`.

Suggested-by: Alice Ryhl &lt;aliceryhl@google.com&gt;
Link: https://github.com/Rust-for-Linux/pin-init/pull/62/commits/58612514b256c6f4a4a0718be25298410e67387a
[ Also fix a compile error in block. - Benno ]
Reviewed-by: Boqun Feng &lt;boqun.feng@gmail.com&gt;
Link: https://lore.kernel.org/all/20250529081027.297648-2-lossin@kernel.org
[ Add title prefix `rust: pin-init`. - Benno ]
Signed-off-by: Benno Lossin &lt;lossin@kernel.org&gt;
</content>
</entry>
</feed>
