Pull rust fix from Miguel Ojeda:

 - Macros: fix 'HAS_*' redefinition by the '#[vtable]' macro
   under conditional compilation

* tag 'rust-fixes-6.5-rc7' of https://github.com/Rust-for-Linux/linux:
  rust: macros: vtable: fix `HAS_*` redefinition (`gen_const_name`)
This commit is contained in:
Linus Torvalds
2023-08-20 08:18:58 +02:00

View File

@@ -74,6 +74,7 @@ pub(crate) fn vtable(_attr: TokenStream, ts: TokenStream) -> TokenStream {
const {gen_const_name}: bool = false;", const {gen_const_name}: bool = false;",
) )
.unwrap(); .unwrap();
consts.insert(gen_const_name);
} }
} else { } else {
const_items = "const USE_VTABLE_ATTR: () = ();".to_owned(); const_items = "const USE_VTABLE_ATTR: () = ();".to_owned();