-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
A-macromacro expansionmacro expansionE-hardS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now
Description
This code results in a wrong expansion of the macro, where the resulting enum only has the first specified variant:
macro_rules! enum_with_unknown {
(
enum $name:ident {
$(
$variant:ident $(,)*
),*
}
) => {
enum $name {
$(
$variant,
)*
}
}
}
enum_with_unknown! {
enum ControlOpcode {
ConnectionUpdateReq,
ChannelMapReq,
}
}
Resulting code according to "Expand macro recursively":
enum ControlOpcode {
ConnectionUpdateReq,
}
(EDIT: Reduced)
Metadata
Metadata
Assignees
Labels
A-macromacro expansionmacro expansionE-hardS-actionableSomeone could pick this issue up and work on it right nowSomeone could pick this issue up and work on it right now