fix: Fix runnables trying to add doc tests in the crate root from #[macro_export] macros

This commit is contained in:
Lukas Wirth
2022-03-18 11:55:53 +01:00
parent bd17933c31
commit 828196be3b
6 changed files with 98 additions and 3 deletions

View File

@@ -76,6 +76,14 @@ pub fn visit_file_defs(
cb(def.into());
}
module.impl_defs(db).into_iter().for_each(|impl_| cb(impl_.into()));
let is_root = module.is_crate_root(db);
module
.legacy_macros(db)
.into_iter()
// don't show legacy macros declared in the crate-root that were already covered in declarations earlier
.filter(|it| !(is_root && it.is_macro_export(db)))
.for_each(|mac| cb(mac.into()));
}
/// Checks if the given lint is equal or is contained by the other lint which may or may not be a group.