blob: 5772baeb657f12396fd8408dd861b55fda48d31f [file] [log] [blame]
Jakub Kotura425e552020-12-21 17:28:15 +01001//!
2//! Implementation's internal macros
3
4macro_rules! debug_fmt_fields {
David LeGareb72e9052022-03-02 16:21:08 +00005 ($tyname:ident, $($($field:tt/*TODO ideally we would accept ident or tuple element here*/).+),*) => {
Jakub Kotura425e552020-12-21 17:28:15 +01006 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
7 f.debug_struct(stringify!($tyname))
8 $(
9 .field(stringify!($($field).+), &self.$($field).+)
10 )*
11 .finish()
12 }
13 }
14}
15
16macro_rules! clone_fields {
17 ($($field:ident),*) => {
18 fn clone(&self) -> Self {
19 Self {
20 $($field: self.$field.clone(),)*
21 }
22 }
23 }
24}
Joel Galensonb593e252021-06-21 13:15:57 -070025
26macro_rules! ignore_ident{
27 ($id:ident, $($t:tt)*) => {$($t)*};
28}