&self
.nodes
.iter_enumerated()
- .map(|(id, parented_node)| (id, parented_node.as_ref().map(|node| node.parent)))
+ .map(|(id, parented_node)| {
+ let parented_node = parented_node.as_ref().map(|node| node.parent);
+
+ debug_fn(move |f| write!(f, "({id:?}, {parented_node:?})"))
+ })
.collect::<Vec<_>>(),
)
.field("bodies", &self.bodies)
static_assert_size!(Res, 12);
static_assert_size!(Stmt<'_>, 32);
static_assert_size!(StmtKind<'_>, 16);
- // tidy-alphabetical-end
- // FIXME: move the tidy directive to the end after the next bootstrap bump
- #[cfg(bootstrap)]
- static_assert_size!(TraitItem<'_>, 88);
- #[cfg(not(bootstrap))]
static_assert_size!(TraitItem<'_>, 80);
- #[cfg(bootstrap)]
- static_assert_size!(TraitItemKind<'_>, 48);
- #[cfg(not(bootstrap))]
static_assert_size!(TraitItemKind<'_>, 40);
static_assert_size!(Ty<'_>, 48);
static_assert_size!(TyKind<'_>, 32);
+ // tidy-alphabetical-end
+}
+
+fn debug_fn(f: impl Fn(&mut fmt::Formatter<'_>) -> fmt::Result) -> impl fmt::Debug {
+ struct DebugFn<F>(F);
+ impl<F: Fn(&mut fmt::Formatter<'_>) -> fmt::Result> fmt::Debug for DebugFn<F> {
+ fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
+ (self.0)(fmt)
+ }
+ }
+ DebugFn(f)
}