syn icon indicating copy to clipboard operation
syn copied to clipboard

Write a test that counts the number of times visit_span is called

Open dtolnay opened this issue 6 years ago • 1 comments

Visiting a particular syntax tree node with syn::visit, the number of calls to visit_span should be equal to the number of tokens when converted into TokenStream. This test would help catch many classes of missing visit calls, including #291.

dtolnay avatar Jul 22 '18 17:07 dtolnay

I see missing visit_span calls in:

  • fields of type TokenStream;
  • some variants of Lit;
  • punctuation of a Punctuated (#291).

dtolnay avatar Mar 24 '19 21:03 dtolnay