Scan calls visit_leaf() when visiting a leaf.