[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] rust: use inline const expressions
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 2/5] rust: use inline const expressions |
Date: |
Tue, 6 May 2025 12:56:34 +0200 |
On Tue, May 6, 2025 at 10:51 AM Zhao Liu <zhao1.liu@intel.com> wrote:
> > - let _: () = CanReceiveFn::ASSERT_IS_SOME;
> > + const { assert!(CanReceiveFn::IS_SOME) };
>
> Do you think it's a good idea to warp this as a helper for easy
> callback calls?
I think the wrapper would be very similar to what exists before this
patch, wouldn't it? The const { assert!(...) } seems clear enough and
not too verbose.
Paolo
- [PATCH preview 0/5] rust: allow minimum version of 1.83, Paolo Bonzini, 2025/05/05
- [PATCH 1/5] meson, cargo: require Rust 1.83.0, Paolo Bonzini, 2025/05/05
- [PATCH 2/5] rust: use inline const expressions, Paolo Bonzini, 2025/05/05
- [PATCH 3/5] rust: vmstate: convert to use builder pattern, Paolo Bonzini, 2025/05/05
- [PATCH 4/5] rust: vmstate: use const_refs_to_static, Paolo Bonzini, 2025/05/05
- [PATCH 5/5] rust: qdev: const_refs_to_static, Paolo Bonzini, 2025/05/05
- Re: [PATCH preview 0/5] rust: allow minimum version of 1.83, Zhao Liu, 2025/05/06