rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benno Lossin <benno.lossin@proton.me>
To: Altan Ozlu <altan@ozlu.eu>, Miguel Ojeda <ojeda@kernel.org>,
	Alex Gaynor <alex.gaynor@gmail.com>
Cc: "Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v2] rust: static_assert: add optional message
Date: Mon, 24 Mar 2025 22:07:58 +0000	[thread overview]
Message-ID: <D8OU7GR41GBP.1ESS80USPVQ4O@proton.me> (raw)

On Mon Mar 24, 2025 at 10:01 PM CET, Altan Ozlu wrote:
> Add optional panic message for `static_assert!` macro.

s/Add/Add an/

> It doesn't support argument formatting, due to `const_format_args`
> being experimental. It will fail to compile if a message with argument
> is given.

I don't think that this is the correct reason to give why it's not
supported. As you mentioned in another mail, the feature is a
compiler-internal feature and is not intended to be stabilized. Yes the
error reported by the compiler references the `const_format_args` macro,
but that's an implementation detail of `assert`, so I wouldn't put too
much weight into it.

Instead I would just say that `assert!` doesn't yet support formatting
in const contexts (maybe also add that to the documentation, so someone
will complain when that's been implemented and it flew under our radar).

> Suggested-by: Miguel Ojeda <ojeda@kernel.org>
> Link: https://github.com/Rust-for-Linux/linux/issues/1149
> Signed-off-by: Altan Ozlu <altan@ozlu.eu>

Usually when sending a new version of a patch, you don't send it in
reply to the previous version.

---
Cheers,
Benno

> ---
>  rust/kernel/static_assert.rs | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)


             reply	other threads:[~2025-03-24 22:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24 22:07 Benno Lossin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-03-24 18:45 [PATCH] rust: static_assert: add optional message Altan Ozlu
2025-03-24 21:01 ` [PATCH v2] " Altan Ozlu

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=D8OU7GR41GBP.1ESS80USPVQ4O@proton.me \
    --to=benno.lossin@proton.me \
    --cc=a.hindborg@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=altan@ozlu.eu \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --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).