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

Qingsong Chen posted 1 patch 2 years, 7 months ago
rust/macros/vtable.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH 0/1] Fix redefine const_name in `vtable` macro
Posted by Qingsong Chen 2 years, 7 months ago
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