[PATCH 01/18] rust: condvar: avoid `pub` in example
From: Miguel Ojeda
Date: Mon Nov 10 2025 - 04:51:28 EST
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>
---
rust/kernel/sync/condvar.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/kernel/sync/condvar.rs b/rust/kernel/sync/condvar.rs
index aa5b9a7a726d..1e66e9f548a3 100644
--- a/rust/kernel/sync/condvar.rs
+++ b/rust/kernel/sync/condvar.rs
@@ -46,7 +46,7 @@ macro_rules! new_condvar {
/// use kernel::sync::{new_condvar, new_mutex, CondVar, Mutex};
///
/// #[pin_data]
-/// pub struct Example {
+/// struct Example {
/// #[pin]
/// value: Mutex<u32>,
///
--
2.51.2