linux-stable/rust
Qingsong Chen 3fa7187ece rust: macros: vtable: fix HAS_* redefinition (gen_const_name)
If we define the same function name twice in a trait (using `#[cfg]`),
the `vtable` macro will redefine its `gen_const_name`, e.g. this will
define `HAS_BAR` twice:

    #[vtable]
    pub trait Foo {
        #[cfg(CONFIG_X)]
        fn bar();

        #[cfg(not(CONFIG_X))]
        fn bar(x: usize);
    }

Fixes: b44becc5ee ("rust: macros: add `#[vtable]` proc macro")
Signed-off-by: Qingsong Chen <changxian.cqs@antgroup.com>
Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Sergio González Collado <sergio.collado@gmail.com>
Link: https://lore.kernel.org/r/20230808025404.2053471-1-changxian.cqs@antgroup.com
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2023-08-09 21:15:07 +02:00
..
alloc rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
bindings rust: allocator: Prevent mis-aligned allocation 2023-08-04 17:10:31 +02:00
kernel rust: delete ForeignOwnable::borrow_mut 2023-08-04 17:10:50 +02:00
macros rust: macros: vtable: fix HAS_* redefinition (gen_const_name) 2023-08-09 21:15:07 +02:00
uapi rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
.gitignore rust: uapi: Add UAPI crate 2023-04-22 01:46:45 +02:00
bindgen_parameters rust: bindgen: Add alt_instr as opaque type 2023-03-02 22:44:15 +01:00
build_error.rs rust: add build_error crate 2022-12-04 01:59:16 +01:00
compiler_builtins.rs rust: compiler_builtins: make stubs non-global 2023-01-16 21:04:34 +01:00
exports.c rust: add build_error crate 2022-12-04 01:59:16 +01:00
helpers.c rust: error: impl Debug for Error with errname() integration 2023-06-13 01:24:42 +02:00
Makefile rust: fix bindgen build error with UBSAN_BOUNDS_STRICT 2023-08-04 17:10:50 +02:00