refactor: prepare to associate multiple spans with a module.

This commit is contained in:
Felix S. Klock II 2022-01-20 11:06:45 -05:00
parent 4566094913
commit e9035f7bef
9 changed files with 30 additions and 14 deletions

View file

@ -129,7 +129,9 @@ impl<'a> MutVisitor for TestHarnessGenerator<'a> {
// We don't want to recurse into anything other than mods, since
// mods or tests inside of functions will break things
if let ast::ItemKind::Mod(_, ModKind::Loaded(.., span)) = item.kind {
if let ast::ItemKind::Mod(_, ModKind::Loaded(.., ast::ModSpans { inner_span: span })) =
item.kind
{
let prev_tests = mem::take(&mut self.tests);
noop_visit_item_kind(&mut item.kind, self);
self.add_test_cases(item.id, span, prev_tests);