Re: [PATCH v2] rust: impl_flags: add conversions for raw flag representations
From: Felipe Agger
Date: Wed Sep 30 2026 - 14:00:09 EST
Em seg., 21 de set. de 2026 às 00:36, Alexandre Courbot
<acourbot@xxxxxxxxxx> escreveu:
>
> On Mon Sep 21, 2026 at 4:18 AM JST, Filipe Xavier wrote:
> > Extend the impl_flags! macro to support conversions between generated flag
> > types and raw C/UAPI integers. Implement TryFrom<Repr> for individual flags
> > (exact variant match) and flag sets (rejecting unknown bits), along with an
> > unsafe from_raw() constructor for flag sets. Additionally, add BitOr and
> > BitOrAssign implementations between the raw representation and flag types.
>
> This does 3 different things and would be much more comfortable to
> review if split into 3 distinct patches.
Some things are directly related to this patch, and sending them
separately wouldn't work,
as it would break the build (as happened with v1 for Tyr).
It also seems odd to me to create a class without using it anywhere,
only to use it in a later patch. But I’m open to hearing other opinions on this.