[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230626074242.3945398-1-changxian.cqs@antgroup.com>
Date: Mon, 26 Jun 2023 15:42:41 +0800
From: "Qingsong Chen" <changxian.cqs@...group.com>
To: linux-kernel@...r.kernel.org
Cc: "田洪亮" <tate.thl@...group.com>,
"Qingsong Chen" <changxian.cqs@...group.com>,
"Miguel Ojeda" <ojeda@...nel.org>,
"Alex Gaynor" <alex.gaynor@...il.com>,
"Wedson Almeida Filho" <wedsonaf@...il.com>,
"Boqun Feng" <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
"Björn Roy Baron" <bjorn3_gh@...tonmail.com>,
"Benno Lossin" <benno.lossin@...ton.me>,
<rust-for-linux@...r.kernel.org>
Subject: [PATCH 0/1] Fix redefine const_name in `vtable` macro
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
Powered by blists - more mailing lists