Re: [PATCH 01/18] rust: condvar: avoid `pub` in example

From: Alice Ryhl
Date: Mon Nov 10 2025 - 05:26:58 EST


On Mon, Nov 10, 2025 at 10:50:06AM +0100, Miguel Ojeda wrote:
> The future move of pin-init to `syn` uncovers the following unreachable
> public item in an example:
>
> error: unreachable `pub` item
> --> rust/doctests_kernel_generated.rs:14683:1
> |
> 14683 | pub struct Example {
> | ---^^^^^^^^^^^^^^^
> | |
> | help: consider restricting its visibility: `pub(crate)`
> |
> = help: or consider exporting it for use by other crates
> = note: `-D unreachable-pub` implied by `-D warnings`
> = help: to override `-D warnings` add `#[allow(unreachable_pub)]`
>
> There is no real downside of keeping the example as-is until the
> `syn`-based pin-init is introduced, so there is no need to treat it as
> a fix nor to backport it. However, we still need to change it before
> introducing the new pin-init.
>
> Thus do so.
>
> Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>

The unreachable_pub warning normally does not trigger for documentation
tests since using `pub` in documentation tests is not wrong. So this
sounds like a bug in our doc-test setup.

Regardless, I don't mind changing it here for now.

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>