Unnamed repository; edit this file 'description' to name the repository.
make diagnostic function public
Kartavya Vashishtha 2022-08-08
parent 196f389 · commit c1eae3d
-rw-r--r--crates/hir-def/src/nameres.rs8
-rw-r--r--crates/hir-def/src/nameres/diagnostics.rs2
2 files changed, 9 insertions, 1 deletions
diff --git a/crates/hir-def/src/nameres.rs b/crates/hir-def/src/nameres.rs
index 45f631936d..a2181a6bf4 100644
--- a/crates/hir-def/src/nameres.rs
+++ b/crates/hir-def/src/nameres.rs
@@ -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
}
diff --git a/crates/hir-def/src/nameres/diagnostics.rs b/crates/hir-def/src/nameres/diagnostics.rs
index 0d01f6d0ab..ed7e920fd2 100644
--- a/crates/hir-def/src/nameres/diagnostics.rs
+++ b/crates/hir-def/src/nameres/diagnostics.rs
@@ -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,