[PATCH 0/1] Fix redefine const_name in `vtable` macro

From: Qingsong Chen
Date: Mon Jun 26 2023 - 03:43:00 EST


Hi!

When using the `vtable` macro, I may find a problem.
If we define same function name in a trait (using `#[cfg]`),
the `vtable` macro will redefine `gen_const_name` for it, for
example:
```rust
#[vtable]
pub trait Foo {
#[cfg(CONFIG_X)]
fn bar();

#[cfg(not(CONFIG_X))]
fn bar(x: usize);
}
```
This will define `HAS_BAR` twice. So I try to fix this by
using `HashSet`.

Qingsong Chen (1):
rust: macros: fix redefine const_name in `vtable`

rust/macros/vtable.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--
2.40.1