Linux Documentation
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "FUJITA Tomonori" <tomo@flapping.org>, <corbet@lwn.net>,
	<ojeda@kernel.org>
Cc: <a.hindborg@kernel.org>, <acourbot@nvidia.com>,
	<aliceryhl@google.com>, <bjorn3_gh@protonmail.com>,
	<boqun@kernel.org>, <dakr@kernel.org>,
	<daniel.almeida@collabora.com>, <gary@garyguo.net>,
	<lossin@kernel.org>, <rdunlap@infradead.org>,
	<skhan@linuxfoundation.org>, <tamird@kernel.org>,
	<tmgross@umich.edu>, <work@onurozkan.dev>,
	<linux-doc@vger.kernel.org>, <rust-for-linux@vger.kernel.org>,
	"FUJITA Tomonori" <fujita.tomonori@gmail.com>
Subject: Re: [PATCH v2] docs: rust: add guidelines for Display and Debug
Date: Tue, 01 Dec 2026 13:44:52 +0000	[thread overview]
Message-ID: <DN9FWFVWFNIE.1MXCL7LV3QLAK@garyguo.net> (raw)
In-Reply-To: <20261130234307.750295-1-tomo@flapping.org>

On Mon Nov 30, 2026 at 11:43 PM GMT, FUJITA Tomonori wrote:
> From: FUJITA Tomonori <fujita.tomonori@gmail.com>
> 
> The kernel crate has no written rule about when a type should implement
> Display and when it should implement only Debug. This came up in the
> review of a patch that adds Display for Delta.
> 
> Add a section that follows the usual Rust convention, with one kernel
> specific point about types that correspond to C types. Also say that
> the output of Debug may change, and that a type should provide a
> method when a stable output is needed.
> 
> Link: https://lore.kernel.org/rust-for-linux/87se19qgeu.fsf@t14s.mail-host-address-is-not-set/
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@gmail.com>

Reviewed-by: Gary Guo <gary@garyguo.net>

> ---
> v2:
> - Remove the anchor from the Display link (Miguel)
> - Say that the Debug output may change (Miguel)
> - Suggest a method for a stable output, e.g. Delta::as_nanos (Miguel)
> v1: https://lore.kernel.org/rust-for-linux/20261115214025.2122718-1-tomo@flapping.org/
> ---
>  Documentation/rust/coding-guidelines.rst | 26 ++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)


      parent reply	other threads:[~2026-12-01 13:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <SPsuLLzxgxO7PaZCjQrJslthAe9jYAU5mRDRgypaT3BVUAG4QEuuGTFfiDVZT42xuKDHHNXOuT-dT0Y-_I9LFA==@protonmail.internalid>
2026-11-30 23:43 ` [PATCH v2] docs: rust: add guidelines for Display and Debug FUJITA Tomonori
2026-12-01 10:08   ` Andreas Hindborg
2026-12-01 13:34   ` Alice Ryhl
2026-12-01 13:44   ` Gary Guo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN9FWFVWFNIE.1MXCL7LV3QLAK@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=corbet@lwn.net \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=fujita.tomonori@gmail.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=tomo@flapping.org \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox