lkml.org 
[lkml]   [2023]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[PATCH 0/1] Fix redefine const_name in `vtable` macro
Date
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

\
 
 \ /
  Last update: 2023-06-26 09:43    [W:0.085 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site