make diagnostic function public

This commit is contained in:
Kartavya Vashishtha 2022-08-08 16:45:27 +05:30
parent 196f389a70
commit c1eae3d028
No known key found for this signature in database
GPG Key ID: A50012C2324E5DF0
2 changed files with 9 additions and 1 deletions

View File

@ -511,6 +511,14 @@ impl DefMap {
self.diagnostics.as_slice()
}
pub fn push_diagnostic(&mut self, d: DefDiagnostic) {
self.diagnostics.push(d)
}
pub fn push_diagnostics(&mut self, i: impl Iterator<Item = DefDiagnostic>) {
self.diagnostics.extend(i)
}
pub fn recursion_limit(&self) -> Option<u32> {
self.recursion_limit
}

View File

@ -73,7 +73,7 @@ impl DefDiagnostic {
Self { in_module: container, kind: DefDiagnosticKind::UnresolvedImport { id, index } }
}
pub(super) fn unconfigured_code(
pub fn unconfigured_code(
container: LocalModuleId,
ast: AstId<ast::Item>,
cfg: CfgExpr,