libbinder_rs: allow attributes for enumerators
declare_binder_enum macro now allows attributes for enumerators so that
an enumerator can be deprecated.
Bug: 218401941
Test: aidl_integration_test
Change-Id: If34fd88db3bee498a65d2d66eae14caa8583d0cf
diff --git a/libs/binder/rust/src/binder.rs b/libs/binder/rust/src/binder.rs
index 467e51e..5d6206d 100644
--- a/libs/binder/rust/src/binder.rs
+++ b/libs/binder/rust/src/binder.rs
@@ -1086,7 +1086,7 @@
{
$( #[$attr:meta] )*
$enum:ident : [$backing:ty; $size:expr] {
- $( $name:ident = $value:expr, )*
+ $( $( #[$value_attr:meta] )* $name:ident = $value:expr, )*
}
} => {
$( #[$attr] )*
@@ -1094,7 +1094,7 @@
#[allow(missing_docs)]
pub struct $enum(pub $backing);
impl $enum {
- $( #[allow(missing_docs)] pub const $name: Self = Self($value); )*
+ $( $( #[$value_attr] )* #[allow(missing_docs)] pub const $name: Self = Self($value); )*
#[inline(always)]
#[allow(missing_docs)]