lkml.org 
[lkml]   [2023]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3] rust: macros: vtable: fix `HAS_*` redefinition (`gen_const_name`)
On Tue, Aug 8, 2023 at 4:54 AM Qingsong Chen <changxian.cqs@antgroup.com> 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@antgroup.com>

Applied to `rust-fixes`, thanks everyone!

Cheers,
Miguel

\
 
 \ /
  Last update: 2023-08-09 21:29    [W:0.052 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site