From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0FC01F03DE for ; Mon, 1 Dec 2025 19:28:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764617342; cv=none; b=bDr/e+82wuKQQ9adEjCqToDmuk0LFIgEhqUQxV+g+/Z+WCMQeAHYVHk29DUXL+J9Lof2tA3DVuayBans0UgdIXYvgVFL/aYuY0/PcNd4xOB75anzZtrEIdU8sPi4Uk0yKWV2z6cgjsqaySswybp6QMTQO7jv2rfpLs2epjLU+wY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764617342; c=relaxed/simple; bh=zfeMB2LmDcZWaYDjv7dMc5Q8/0QMwZt5kUiecWTGvyY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dY4glxTnobspUVa6mMVG7v5847FjGhluR+xuHQdzEUx0/GfKm4sujvcQ9t1+lTqHEdCr7q7FA0BZ/ou6UJYx25m7Uupa0gn9bV799b5AKsKKqMYINWtu2gvUOUxrtqh37G5jdXqRBS/XjablClXm1APnTYL+W6qRhg5GCZwbhAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BrSfb6b8; arc=none smtp.client-ip=209.85.128.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BrSfb6b8" Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-787da30c53dso44085497b3.0 for ; Mon, 01 Dec 2025 11:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764617339; x=1765222139; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=APljFRXaMCw5fST76I/JdjoAg3NunNjrMcBFSHPBuyM=; b=BrSfb6b8Zn0E9ux4nn3O4x7dicge5iSK9nYgBuysy+AFo2EdH/eLpkRdzBok1ewZOJ IGOHvLVs1hwoFs8NYcftFeyxM3VDexUSJcWWc0CG7JzboclczRb4XBOK2ZHHyBQuVJfQ Le1BbXRj1k9/R/SisTQeDVZy/QbToA6JYtDL0HPGeqsxLjyPjyQ1joT1ZpDy/nd+5iTC eQ7y8syQX3SGAMJgcMzfH2iAVuCMxh+DTNjAJ+19ix2CrujxKjJu/O7Hp4CbQD30VPfS 8LWml3GfzvMKVvJk9dlzG16aLHC+Q7z4if4AnZclNJ6Xbwb9awwDekBuH5TUZyQ3AKNF BT/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764617339; x=1765222139; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=APljFRXaMCw5fST76I/JdjoAg3NunNjrMcBFSHPBuyM=; b=XFs16NiVFKdbckS36WNynOrPICcnmL2dnca92KtI/46Ti07c1fH8Fs7jUg4HA5mbgB hYNWGVWBDqekmavOfxRVf6kEJIYNd6+VIN63XTt4fcVvdnjHr+Eb7DaqMeXjvoeuaEYj ct7MNHqKEgF6/pFXwgKF8ZhKiKdhsGnbo/eAjL1cGlR2/lRo0AhPiV76vf7bXM9BCr95 tJZv+yw+qV+oEp08AoJpqAtQobSJtToA7gifdtMVy+CpxNsc48OPPa14RNzx9BmiGBfS tKkFJyDJh5Z543rqNwl+iFvaEwTiN5AGGuNP6N+7jbiSC8E4vQf+R1o4AQeMtMxU+B+D bw2A== X-Forwarded-Encrypted: i=1; AJvYcCUNIZgkophmK1FNdjtMs5cDQs6C8dkGjvtYvzbK+4LaYThShg69bNLNn/0unUIoTUg1QjImqUtiemx2nnE=@vger.kernel.org X-Gm-Message-State: AOJu0YwBnMLq1SncFQOX/KBqRIf6XNNPqj7mU9m1kIT1EAXOBKr8YIrO CqHCL5OB/x+WLmYXhYGFqZ93gkvjwmCDVrgbIhTZ/ztq2rZZAQps8AJK6lRceg== X-Gm-Gg: ASbGncu6TOZGpCsyFXxCj0uZV4Dk2SWe7Nrpc5sI2W40hC3en2vXb5zYyI0Uu+WsQPb cejReUcc7BnmDT7NvPu1+Iiuf+o7jhw1ed/ix3FnOI+quxGIk4yoBxjXhvKMFQ1IDhcuij+M6aP Z8oPQgwDp64ZG/0EX0OHxLPTbXaYT24FAe+MD4WqnRpI21zu70E+ryv+xD25fUktV3ZYVCg58q7 /Stm6ccvwHvKwfZJnBLrdzLy7xRl9reMKyf4aR18C6yuNsu9x5X9uZieDuAQKY0yje+jgOSTZ8Y yF4OgNkadSBgOX3wx5ucNCd28v9G1mF8eObVc6J12RVn8eaCnkBQ0lIygSEjhnsMPTFB6LR5Vt9 i99t1VKZUI6Sftn68sszzoIsVP1MpXPqvVpg3uuDrSYOwGW+vUiDh/XkgcrZqKATLjD4Og6qokk IMf1GLQBU= X-Google-Smtp-Source: AGHT+IEttKn+//7++pOLi55YpQ9X7GejnUD2spd1fxC6Tw+xPr7mkrw42iQi7Zwskp5SI1O4LeCa3g== X-Received: by 2002:a05:690c:4483:b0:784:8647:4958 with SMTP id 00721157ae682-78a8b56803bmr355020387b3.67.1764617338630; Mon, 01 Dec 2025 11:28:58 -0800 (PST) Received: from localhost ([2601:346:0:79bd:affb:cf6e:b908:f700]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78ad102d25csm53088337b3.44.2025.12.01.11.28.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Dec 2025 11:28:58 -0800 (PST) Date: Mon, 1 Dec 2025 14:28:57 -0500 From: Yury Norov To: Miguel Ojeda Cc: Alice Ryhl , Burak Emir , Alex Gaynor , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH] rust: id_pool: fix example Message-ID: References: <20251201000949.1626363-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251201000949.1626363-1-ojeda@kernel.org> On Mon, Dec 01, 2025 at 01:09:49AM +0100, Miguel Ojeda wrote: > 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 Thanks Miguel, I applied this, but the fact that you've sent a second fix to documentation that actually is a build fix, raises the questions. Because Rust documentation bears compilable chunks of code, I think we need to enable rustdoc tests target by default, so that developers will not send broken tests. Thanks, Yury > --- > 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