Re: [PATCH v3] rust: macros: vtable: fix `HAS_*` redefinition (`gen_const_name`)

From: Miguel Ojeda
Date: Wed Aug 09 2023 - 15:29:10 EST


On Tue, Aug 8, 2023 at 4:54 AM Qingsong Chen <changxian.cqs@xxxxxxxxxxxx> wrote:
>
> If we define the same function name twice in a trait (using `#[cfg]`),
> the `vtable` macro will redefine its `gen_const_name`, e.g. this will
> define `HAS_BAR` twice:
>
> #[vtable]
> pub trait Foo {
> #[cfg(CONFIG_X)]
> fn bar();
>
> #[cfg(not(CONFIG_X))]
> fn bar(x: usize);
> }
>
> Fixes: b44becc5ee80 ("rust: macros: add `#[vtable]` proc macro")
> Signed-off-by: Qingsong Chen <changxian.cqs@xxxxxxxxxxxx>

Applied to `rust-fixes`, thanks everyone!

Cheers,
Miguel