Rust fixes for 6.5-rc7

- Macros: fix 'HAS_*' redefinition by the '#[vtable]' macro
    under conditional compilation.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPjU5OPd5QIZ9jqqOGXyLc2htIW0FAmThFSQACgkQGXyLc2ht
 IW1H5w/7BrYr2h+KYBtpDKagivO1Gm+OnIY0T2cN/bv+6Wt3XFqjyXrlUpQYZpVA
 s6V7W7ihJ2+HThGIZNrrjtFX/MetRxc4PT8RH3ixOkd7yggPfHegRGI59QNrHeAB
 9Z8hhhTp2qqcBq4asA+5twsO6HBuGAfVRCyi62dhfmq3fGUGhp7PWKrIOZ+Fd5bX
 SgU0uqHJegyXSx5obH5pwMM+CMr6+obgM99DWMCbKEysS1kEapZg8o5jQ+8wmpsh
 vnUfMt7vtWVrd1KHV+lyVJz1VgugQudfd3YyO1RueAc8uq1sNexTTgz7wqDDLiN2
 KuGIVFt5+iMcgUbRzPA87muArpIOBJntjt20i4HUb+Xj5lp8raLUuvs1lF6iPvbK
 WqxGhpnA81UuYnWpshUx0iqv6lZFIYZ2WlhGcvQcpCKVkWdCgEUDRMdi9ZRvCRyQ
 2ezye2c8sBhjvSmKcvQSMWY2sE3IQ4MRqbyiV9qnXnLe83FNDX5VuFAsShBKFpsa
 A4I6LkCVWjBcLTDi+ggg6cAzWTQtULzi7acwWS3qw4W0Yj/jtHH4Ire9EljW/CV/
 CvM+7p59Ff18h28Pz6dip5s/n1VEVZozeTOIonw9p28Na+5Y+pUbRkpoZZh6mYhW
 So55wSLR4TT7lYY9W1PgW5NEcTZm0BuJ9ZJwNsySy5NU7kWfvZk=
 =McGU
 -----END PGP SIGNATURE-----

Merge tag 'rust-fixes-6.5-rc7' of https://github.com/Rust-for-Linux/linux

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
commit ec27a636d7
1 changed files with 1 additions and 0 deletions

View File

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