lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <489c795a-ad6e-47b9-9443-aa315d59a74c@gmail.com>
Date: Sat, 7 Jun 2025 22:19:34 +0200
From: Christian Schrefl <chrisi.schrefl@...il.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
 Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>,
 Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
 Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
 Danilo Krummrich <dakr@...nel.org>, linux-kernel@...r.kernel.org,
 rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: add `assert_sync` function

On 07.06.25 7:29 PM, Miguel Ojeda wrote:
> On Sat, Jun 7, 2025 at 3:02 PM Christian Schrefl
> <chrisi.schrefl@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ