Messages in this thread | | | From | "Qingsong Chen" <> | Subject | [PATCH 0/1] Fix redefine const_name in `vtable` macro | Date | Mon, 26 Jun 2023 15:42:41 +0800 |
| |
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
| |