From: Ritvik Gupta <ritvikfoss@gmail.com>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com,
gary@garyguo.net, bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, aliceryhl@google.com, tmgross@umich.edu,
dakr@kernel.org, rust-for-linux@vger.kernel.org,
skhan@linuxfoundation.org
Subject: Re: [PATCH] rust: kernel: introduce `unsafe_precondition_assert!` macro
Date: Tue, 22 Jul 2025 17:43:16 +0530 [thread overview]
Message-ID: <aH-AXKaEqcN2Wuzg@fedora> (raw)
In-Reply-To: <CANiq72=C=VHGXFvGuSY7rnNOvW-2yAA_g5yQamVN-mG9btwMkg@mail.gmail.com>
Just to be clear for v2,
the caller should be able to call this way?
```
// Allowed
unsafe_precondition_assert!(condition, "message");
unsafe_precondition_assert!(condition, "formatted message: {} {} {}", arg1, arg2, argn);
// Not allowed?
unsafe_precondition_assert!(condition)
```
When the assertion fails, this will be the output:
```
precondition(s) violated: message passed by caller
```
next prev parent reply other threads:[~2025-07-22 12:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 4:59 [PATCH] rust: kernel: introduce `unsafe_precondition_assert!` macro Ritvik Gupta
2025-07-21 21:51 ` Miguel Ojeda
2025-07-22 11:44 ` Ritvik Gupta
2025-07-22 12:13 ` Ritvik Gupta [this message]
2025-07-22 12:31 ` Miguel Ojeda
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=aH-AXKaEqcN2Wuzg@fedora \
--to=ritvikfoss@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=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=skhan@linuxfoundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.