rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schrefl <chrisi.schrefl@gmail.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@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 22:19:34 +0200	[thread overview]
Message-ID: <489c795a-ad6e-47b9-9443-aa315d59a74c@gmail.com> (raw)
In-Reply-To: <CANiq72m04yAwxtMbctCpiDpYzoMHpiDagEJsvHHJCZNJXyJ5KQ@mail.gmail.com>

On 07.06.25 7:29 PM, Miguel Ojeda wrote:
> 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.

Alright.

> 
>> +/// 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?

I added this because for some reason I was convinced that it would
be possible to cause post-monomorphization errors with this, but I 
not realize that's not a thing. I guess I'll just drop this sentence.

>> +/// # 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.

Fixed these

Cheers
Christian

      reply	other threads:[~2025-06-07 20:19 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
2025-06-07 20:19   ` Christian Schrefl [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=489c795a-ad6e-47b9-9443-aa315d59a74c@gmail.com \
    --to=chrisi.schrefl@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=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --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).