[PATCH] rust: id_pool: fix example

From: Miguel Ojeda

Date: Sun Nov 30 2025 - 19:10:07 EST


When building with KUnit doctests enabled, `rustc` reports:

error[E0599]: no method named `acquire_next_id` found for struct `IdPool` in the current scope
--> rust/doctests_kernel_generated.rs:6722:24
|
6722 | assert_eq!(i, pool.acquire_next_id(i).ok_or(ENOSPC)?);
| ^^^^^^^^^^^^^^^ method not found in `IdPool`

Thus fix it.

Fixes: a5726454470c ("rust: id_pool: do not immediately acquire new ids")
Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx>
---
I saw this in -next.

rust/kernel/id_pool.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/kernel/id_pool.rs b/rust/kernel/id_pool.rs
index 73a952d7dd83..384753fe0e44 100644
--- a/rust/kernel/id_pool.rs
+++ b/rust/kernel/id_pool.rs
@@ -28,7 +28,7 @@
///
/// let mut pool = IdPool::with_capacity(64, GFP_KERNEL)?;
/// for i in 0..64 {
-/// assert_eq!(i, pool.acquire_next_id(i).ok_or(ENOSPC)?);
+/// assert_eq!(i, pool.find_unused_id(i).ok_or(ENOSPC)?.acquire());
/// }
///
/// pool.release_id(23);

base-commit: 00c5ce039598e692e1dd4bf2b3ad5bc08bdf3270
--
2.52.0