From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE9371DC9B5; Sat, 16 Aug 2025 19:35:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755372933; cv=none; b=raLVoWhdxVonuw9ukXlJDXh7PkWzFm/Wt5AOtOkMp60m6fiRwNHGkmRSgXhFeuGWW6qaT12SsLfV4b8F60oy3Ft8/GmG7GmlfuJ8gTs0ivhC+fEUlvCsxn7tFutOQK5GQDNWvZC0tlqOnlkL6T35dFjMT8TwQ+cu1pXiwFO1gNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755372933; c=relaxed/simple; bh=WlPCp9fVlPwFTXS7XmQr33PixxriCbunSTJIpHN/Lvg=; h=Mime-Version:Content-Type:Date:Message-Id:From:To:Cc:Subject: References:In-Reply-To; b=TAC2P0+hl4fI2ViAjp/foTHWPljn6+3UTipkK4x+w6DjIEyC7psunzw+VATHyQoSNb9XV0Nb58eEvsZiAvf1FQExIoWjwWwmrl5U+EyR/Z8WP0YZR7gjRX4fRdWnFpgqiP+jsxuiDSSsakW+ajrUYglkaztTVnw3mbHSkbt1LB4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LGP8DpDo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="LGP8DpDo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D0ADC4CEEF; Sat, 16 Aug 2025 19:35:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1755372933; bh=WlPCp9fVlPwFTXS7XmQr33PixxriCbunSTJIpHN/Lvg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LGP8DpDoQHmXQZJhujUuaz5XK7bx94w3tlAszPyywczhD/Qlt7TI+nFQF9cJeMjmH qfIkSax1djg7lcCDwXQcycsuQ+a4n0yktlZVIU0c4aE+HBc3Qq+sA+UtvEdN98Oqed 3HiWP0pgRV9vKXLVHAnZouzQAphHCPV83BnARNrKLvuBELFbZ6MnKb7FRecx3KNtuX FjAEJzY0Em5+8j0GVjV0jVtKnHmB5Tqp8F/e724kPixcMSmykK1dd6hIUF3jydOFVR yfY5vaTs7Nbonto/cUG+r/Ugp2BFvesaGJWeTuFIZ5vMOVR/r5d40HK8fYBE/nSrIg LFrfCO37hTrWA== Precedence: bulk X-Mailing-List: lkmm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 16 Aug 2025 21:35:26 +0200 Message-Id: From: "Benno Lossin" To: "Boqun Feng" Cc: , , , , "Miguel Ojeda" , "Alex Gaynor" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Will Deacon" , "Peter Zijlstra" , "Mark Rutland" , "Wedson Almeida Filho" , "Viresh Kumar" , "Lyude Paul" , "Ingo Molnar" , "Mitchell Levy" , "Paul E. McKenney" , "Greg Kroah-Hartman" , "Linus Torvalds" , "Thomas Gleixner" , "Alan Stern" Subject: Re: [PATCH v8 6/9] rust: sync: atomic: Add the framework of arithmetic operations X-Mailer: aerc 0.20.1 References: <20250719030827.61357-1-boqun.feng@gmail.com> <20250719030827.61357-7-boqun.feng@gmail.com> In-Reply-To: On Sat Aug 16, 2025 at 6:10 PM CEST, Boqun Feng wrote: > On Tue, Aug 12, 2025 at 10:04:12AM +0200, Benno Lossin wrote: >> On Sat Jul 19, 2025 at 5:08 AM CEST, Boqun Feng wrote: >> > +/// Types that support atomic add operations. >> > +/// >> > +/// # Safety >> > +/// >> > +/// `wrapping_add` any value of type `Self::Repr::Delta` obtained by = [`Self::rhs_into_delta()`] to >>=20 >> Can you add a normal comment TODO here: >>=20 >> // TODO: properly define `wrapping_add` in this context. > > Yeah, this sounds good to me. How do you propose we arrange the normal > comment with the doc comment, somthing like: > > // TODO: properly define `wrapping_add` in this context. > =20 > /// Types that support atomic add operations. > /// > /// # Safety > /// > /// `wrapping_add` any value of type `Self::Repr::Delta` obtained by = [`Self::rhs_into_delta()`] to > ... > pub unsafe trait AtomicAdd<...> { > ... > } Inline maybe? /// Types that support atomic add operations. /// /// # Safety /// // TODO: properly define `wrapping_add` in this context: /// `wrapping_add` any value of type `Self::Repr::Delta` obtained by [`= Self::rhs_into_delta()`] to /// any value of type `Self::Repr` obtained through transmuting a value= of type `Self` to must /// yield a value with a bit pattern also valid for `Self`. --- Cheers, Benno