pub struct Meta {
pub span: Span,
pub expansion: Vec<(Arc<str>, Span)>,
pub doc: Option<Arc<str>>,
pub comments: Option<Box<Comments>>,
}Expand description
Everything a Node knows about itself beyond its shape.
Fields§
§span: Span§expansion: Vec<(Arc<str>, Span)>The macro expansion chain this node came out of, innermost last. Empty for source code.
doc: Option<Arc<str>>The ## doc comment written immediately above this node, lines joined by \n with the
marker and one leading space stripped (crate::doc).
Metadata rather than a form, for the same reason a span is: a doc comment is not part of a
node’s identity (Node::structurally_eq), so every pass that matches on def or model
keeps working and a doc-only edit is not a change of meaning.
comments: Option<Box<Comments>>The ordinary # comments written around this node (crate::doc).
Boxed and absent by default, because most nodes have none and every node pays for the
field. Metadata for the same reason doc is: a comment is not part of a node’s identity,
so adding one does not invalidate a memo or move an interface digest.