The ViewMut mechanism lets clients steal* subnodes of a tree for rewriting purposes.
To steal a subnode, it needs to create a Default::default() node, but this can lead
to infinite recursions if the default case happens to rely upon a node of the same type.
This patch introduces Foo::BinASTStolen for all AST enums Foo, which serves to
generate the default node, and serves whenever we steal a node.
The ViewMut mechanism lets clients steal* subnodes of a tree for rewriting purposes. To steal a subnode, it needs to create a
Default::default()
node, but this can lead to infinite recursions if the default case happens to rely upon a node of the same type.This patch introduces
Foo::BinASTStolen
for all AST enumsFoo
, which serves to generate the default node, and serves whenever we steal a node.