Re: [PATCH v2] rust: assertions: add static_assert

2025-04-05 Thread Pierrick Bouvier
On 3/20/25 04:55, Paolo Bonzini 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 me

Re: [PATCH v2] rust: assertions: add static_assert

2025-03-20 Thread Pierrick Bouvier
On 3/20/25 12:19, Pierrick Bouvier wrote: On 3/20/25 04:55, Paolo Bonzini 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 cons

Re: [PATCH v2] rust: assertions: add static_assert

2025-03-20 Thread Peter Maydell
On Thu, 20 Mar 2025 at 11:55, Paolo Bonzini 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 tha

[PATCH v2] rust: assertions: add static_assert

2025-03-20 Thread Paolo Bonzini
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 Sup