linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
To: Christian Schrefl <chrisi.schrefl@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] rust: add `assert_sync` function
Date: Sat, 7 Jun 2025 19:29:58 +0200	[thread overview]
Message-ID: <CANiq72m04yAwxtMbctCpiDpYzoMHpiDagEJsvHHJCZNJXyJ5KQ@mail.gmail.com> (raw)
In-Reply-To: <20250607-assert_sync-v1-1-b18261da83e2@gmail.com>

On Sat, Jun 7, 2025 at 3:02 PM Christian Schrefl
<chrisi.schrefl@gmail.com> wrote:
>
> +/// Asserts that the given type is [`Sync`]. This check is done at compile time and does nothing
> +/// at runtime.

I would split the second sentence into its own paragraph, so that the
"short description" isn't long.

> +/// Note that this is only intended to avoid regressions and for sanity checks.

Hmm... I am not sure about this sentence. A macro may want to call
this to ensure something that is required for safety, for instance. Is
that the "sanity check" part? In any case, it sounds like the sentence
could be read as "this is not reliable for "other" things apart from
just sanity checks", which may be confusing.

Could we perhaps clarify?

> +/// # Examples
> +/// ```

Please add a newline between these.

> +///
> +///

These newlines should be removed, otherwise they will be rendered.

> +/// // Do the assertion in a const block to make sure it won't be executed at runtime.
> +/// const _:() = {
> +///     assert_sync::<i32>(); // Succeeds because `i32` is Sync

`Sync` and please use a period at the end. Also, I would suggest
following our usual style and putting it at the top, i.e.

    // Succeeds because `i32` is `Sync`.
    assert_sync::<i32>();

> +///
> +/// ```

This one can be removed too.

Cheers,
Miguel

  parent reply	other threads:[~2025-06-07 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-07 13:02 [PATCH] rust: add `assert_sync` function Christian Schrefl
2025-06-07 15:42 ` Benno Lossin
2025-06-07 15:54   ` Christian Schrefl
2025-06-07 17:30     ` Miguel Ojeda
2025-06-07 18:11     ` Benno Lossin
2025-06-07 19:20       ` Christian Schrefl
2025-06-07 22:31         ` Benno Lossin
2025-06-07 23:38           ` Christian Schrefl
2025-06-08  7:41             ` Benno Lossin
2025-06-07 17:29 ` Miguel Ojeda [this message]
2025-06-07 20:19   ` Christian Schrefl

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=CANiq72m04yAwxtMbctCpiDpYzoMHpiDagEJsvHHJCZNJXyJ5KQ@mail.gmail.com \
    --to=miguel.ojeda.sandonis@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=chrisi.schrefl@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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;
as well as URLs for NNTP newsgroup(s).