On Thu, 20 Mar 2025 at 11:55, Paolo Bonzini <pbonz...@redhat.com> wrote: > > 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.mayd...@linaro.org> > Supersedes: <20250320113356.799412-1-pbonz...@redhat.com> > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > --- > rust/qemu-api/src/assertions.rs | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+)
Macro magic in Rust is somewhat beyond my current competency, but it works for my use case, and it looks like it's doing the same thing Linux uses, so on that basis Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> (I put this patch into the series I just sent out that fixes the PL011 size issue.) thanks -- PMM