qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, qemu-rust@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 1/3] rust: assertions: add static_assert
Date: Thu, 20 Mar 2025 23:20:05 +0800	[thread overview]
Message-ID: <Z9wyJWVwSNlAAsNA@intel.com> (raw)
In-Reply-To: <20250320133248.1679485-2-peter.maydell@linaro.org>

On Thu, Mar 20, 2025 at 01:32:46PM +0000, Peter Maydell wrote:
> Date: Thu, 20 Mar 2025 13:32:46 +0000
> From: Peter Maydell <peter.maydell@linaro.org>
> Subject: [PATCH 1/3] rust: assertions: add static_assert
> X-Mailer: git-send-email 2.43.0
> 
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> Add a new assertion that is similar to "const { assert!(...) }" but can be used
> outside functions and with older versions of Rust.  A similar macro is found in
> Linux, whereas the "static_assertions" crate has a const_assert macro that
> produces worse error messages.
> 
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Supersedes: <20250320113356.799412-1-pbonzini@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  rust/qemu-api/src/assertions.rs | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>



  parent reply	other threads:[~2025-03-20 15:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-20 13:32 [PATCH 0/3] rust: Fix PL011State size mismatch assert Peter Maydell
2025-03-20 13:32 ` [PATCH 1/3] rust: assertions: add static_assert Peter Maydell
2025-03-20 14:03   ` Philippe Mathieu-Daudé
2025-03-20 15:20   ` Zhao Liu [this message]
2025-03-20 13:32 ` [PATCH 2/3] hw/char/pl011: Pad PL011State struct to same size as Rust impl Peter Maydell
2025-03-20 15:28   ` Zhao Liu
2025-03-20 13:32 ` [PATCH 3/3] rust: pl011: Check size of state struct at compile time Peter Maydell
2025-03-20 15:45   ` Zhao Liu
2025-03-20 16:02     ` Peter Maydell
2025-03-21  4:31       ` Zhao Liu

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=Z9wyJWVwSNlAAsNA@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@nongnu.org \
    /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).